diff options
author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2004-11-19 19:00:44 +0000 |
---|---|---|
committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2004-11-19 19:00:44 +0000 |
commit | 707400b4c6de94a22075b17d8d4ef08fa75813d9 (patch) | |
tree | 08bcc0e2b57394ba592b82fafa810c15f4114c29 /include/cppunit | |
parent | e321ba14ae0d69ee07bb90fdb6393b8173809644 (diff) | |
download | cppunit-707400b4c6de94a22075b17d8d4ef08fa75813d9.tar.gz |
added specific copy constructor implementatin to ensure string buffer are detached during copy (therefore providing thread-safe copy constructor for non thread-safe std::string copy constructor implementation).
Diffstat (limited to 'include/cppunit')
-rw-r--r-- | include/cppunit/Message.h | 6 | ||||
-rw-r--r-- | include/cppunit/SourceLine.h | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/include/cppunit/Message.h b/include/cppunit/Message.h index 9b12431..1ae51cc 100644 --- a/include/cppunit/Message.h +++ b/include/cppunit/Message.h @@ -40,6 +40,9 @@ class CPPUNIT_API Message public: Message(); + // Ensure thread-safe copy by detaching the string. + Message( const Message &other ); + explicit Message( const std::string &shortDescription ); Message( const std::string &shortDescription, @@ -54,6 +57,8 @@ public: const std::string &detail2, const std::string &detail3 ); + Message &operator =( const Message &other ); + /*! \brief Returns the short description. * \return Short description. */ @@ -127,7 +132,6 @@ public: */ bool operator ==( const Message &other ) const; - /*! \brief Tests if a message is different from another one. * \param other Message this message is compared to. * \return \c true if the two message are not identical, \c false otherwise. diff --git a/include/cppunit/SourceLine.h b/include/cppunit/SourceLine.h index 71eeaed..f7a85df 100644 --- a/include/cppunit/SourceLine.h +++ b/include/cppunit/SourceLine.h @@ -32,9 +32,14 @@ class CPPUNIT_API SourceLine public: SourceLine(); + // Ensure thread-safe copy by detaching the string buffer. + SourceLine( const SourceLine &other ); + SourceLine( const std::string &fileName, int lineNumber ); + SourceLine &operator =( const SourceLine &other ); + /// Destructor. virtual ~SourceLine(); |