|
Carna
Version 3.0.1
|
Represents a composition, i.e. a strong reference. This basically is a std::unique_ptr that supports the Association interface.
More...
#include <Composition.h>
Inheritance diagram for Carna::base::Composition< AssociatedObjectType >:
Collaboration diagram for Carna::base::Composition< AssociatedObjectType >:Public Member Functions | |
| Composition (AssociatedObjectType *associatedObject) | |
| Instantiates. | |
| virtual | ~Composition () |
| Deletes the associated object, if there is one. | |
Public Member Functions inherited from Carna::base::Association< AssociatedObjectType > | |
| 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 | |
Protected Member Functions inherited from Carna::base::Association< AssociatedObjectType > | |
| Association (AssociatedObjectType *associatedObject=nullptr) | |
| Instantiates. | |
Related Functions inherited from Carna::base::Association< AssociatedObjectType > | |
| 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