![]() |
User Manual, Developers Guide and API Documentation |
![]() |
#include <Birthmark.hpp>


Public Member Functions | |
| const Birthmark & | getBirthmark () const |
| Retrieve the birthmark. | |
| HasBirthmark () | |
| Default constructor. | |
| virtual | ~HasBirthmark () |
| Destructor. | |
Protected Member Functions | |
| void | setBirthmark (const Birthmark &other) |
| Set the birthmark of an object. | |
Private Attributes | |
| Birthmark | birthmark |
| Unique identifier. | |
Here's how it works:
If you derive as follows:
#include <WNS/Birthmark.hpp> class Foo : public wns::HasBirthmark {};
each new instance of your class Foo comes equipped with a new and unique 'Birthmark' object. You don't have to worry about its creation. Birthmark objects can be stored locally and have operators to identify them as being equal or unequal.
Example:
Foo a, b; // construct two distinct objects Foo copyOfa(a); // explicit copy of a Foo copyOfb = b; // assignment of b CPPUNIT_ASSERT(a.getBirthmark() != b.getBirthmark()); CPPUNIT_ASSERT(a.getBirthmark() == copyOfa.getBirthmark());
If you clone/copy an object of your class Foo, each cloned/copied object will have the same birthmark, enabling you to detect whether an object is equal to or a clone of some other object.
Birthmarks are NOT:
Definition at line 146 of file Birthmark.hpp.
| HasBirthmark::HasBirthmark | ( | ) |
Definition at line 81 of file Birthmark.cpp.
| HasBirthmark::~HasBirthmark | ( | ) | [virtual] |
Definition at line 87 of file Birthmark.cpp.
| const Birthmark & HasBirthmark::getBirthmark | ( | ) | const |
Definition at line 93 of file Birthmark.cpp.
| void HasBirthmark::setBirthmark | ( | const Birthmark & | other | ) | [protected] |
Definition at line 100 of file Birthmark.cpp.
Birthmark wns::HasBirthmark::birthmark [private] |
Definition at line 183 of file Birthmark.hpp.
1.5.5