Carna
Version 3.3.2
|
Represents a composition, i.e. a strong reference. This basically is a std::unique_ptr
that supports the Association interface.
More...
#include <Composition.h>
Public Member Functions | |
Composition (AssociatedObjectType *associatedObject) | |
Instantiates. | |
virtual | ~Composition () |
Deletes the associated object, if there is one. | |
![]() | |
virtual | ~Association () |
Does nothing. | |
AssociatedObjectType * | get () const |
Returns raw pointer to the referenced object. | |
AssociatedObjectType * | operator-> () const |
AssociatedObjectType & | operator* () const |
Returns raw reference to the referenced object. | |
operator bool () const | |
Tells whether any object is referenced by this association. | |
void | forget () |
Makes this association forget it's referenced object. More... | |
Additional Inherited Members | |
![]() | |
Association (AssociatedObjectType *associatedObject=nullptr) | |
Instantiates. | |
![]() | |
template<typename AssociatedObjectType > | |
bool | operator== (const Carna::base::Association< AssociatedObjectType > &l, const Carna::base::Association< AssociatedObjectType > &r) |
Tells whether l and r do reference the same object, that may be nullptr . | |
Represents a composition, i.e. a strong reference. This basically is a std::unique_ptr
that supports the Association interface.
If an object B
is a component of an object A
, it means that the lifetime of B
is bounded to the lifetime of A
: Therefore, B
is a part of object A
. The same object cannot be part of more than one object at the same time.
Saying that object B
is part of object A
implies that object A possesses B
and is therefore responsible of deleting it at some time.
Definition at line 52 of file Composition.h.
Documentation generated by Doxygen