From 707400b4c6de94a22075b17d8d4ef08fa75813d9 Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Fri, 19 Nov 2004 19:00:44 +0000 Subject: 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). --- include/cppunit/Message.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/cppunit/Message.h') 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. -- cgit v1.2.1