class Link
Defined in:
The TSLink.h
Link
class template encapsulates a smart pointer to an object.
Definition
template <class type> class Link : public ListElement<Link<type>>
Member Functions
Link::GetTarget |
Returns the target to which a link points. |
Template Parameters
type |
The type of object to which the link may point. |
Constructor
Link();
explicit Link(type *target);
Parameters
target |
The object to which the link initially points. |
Description
The Link
class template provides a mechanism through which a smart pointer to an object of the type given by the type
template parameter can be stored. The link to an object is automatically reset to nullptr
if the target object is destroyed. A class of type T
to which a link can be established must inherit from the class LinkTarget<T>
. The LinkTarget
class template stores a list of all links that currently point to it. When the link target is destroyed, all of the links in the list are cleared.
Overloaded Operators
operator type *(void) const; |
A Link object can be implicitly converted to a pointer to the object to which it points.
|
type *operator ->(void) const; |
Dereferencing a Link object is equivalent to dereferencing the pointer that it holds.
|
void operator =(type *target); |
Sets the pointer that the Link object stores.
|
Base Classes
ListElement<Link<type>> |
The set of links to an object are stored in a list by the LinkTarget class.
|
See Also