GPL_Reference::Rep, particularly the
default and copy constructors and the destructor.
GPL_Reference(const GPL_Reference & ref)
Attach this reference to ref, via Attach(ref).
TRUE if the reference is valid (not null).
GPL_Boolean IsShared(void) const
Return TRUE if the reference shares its representation
with at least one other reference.
void Attach(const GPL_Reference & ref)
Makes this reference use the same representation as ref. This
increments the reference count by one.
void Detach(void)
Makes this reference a null reference by clearing its representation.
This decrements the reference count by one and, if this is the last
reference to the data, frees the memory for the representation. This
works because sub-classes have derived their representations from
GPL_Reference::Rep, whose destructor is virtual, and provided
their own destructor.
virtual void Privatize(void)
Makes this reference use a private copy of the data. If the
representation is shared, it makes a private copy using the copy
constructor of GPL_Reference::Rep. Sub-classes that have extended
GPL_Reference::Rep or want different behavior, should provide
their own version of this method. Well-behaved classes invoke this
method prior to any alteration of the shared representation.
| GPL_UPCAST | Declares a register variable of a base class and up-casts the pointer. |
| GPL_ENSURE | Declares a register variable of a class derived from GPL_Reference::Rep after ensuring that the reference has a representation. |