12 #ifndef ASSOCIATION_H_6014714286 13 #define ASSOCIATION_H_6014714286 19 #include <Carna/Carna.h> 43 template<
typename AssociatedObjectType >
61 AssociatedObjectType*
get()
const 63 return associatedObject;
86 return this->
get() !=
nullptr;
105 explicit Association( AssociatedObjectType* associatedObject =
nullptr )
106 : associatedObject( associatedObject )
112 AssociatedObjectType* associatedObject;
129 template<
typename AssociatedObjectType >
132 return l.
get() == r.
get();
137 #endif // ASSOCIATION_H_6014714286 Association(AssociatedObjectType *associatedObject=nullptr)
Instantiates.
void forget()
Makes this association forget it's referenced object.
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.
AssociatedObjectType * get() const
Returns raw pointer to the referenced object.
Represents an association.
AssociatedObjectType & operator*() const
Returns raw reference to the referenced object.
#define NON_COPYABLE
Features class it is placed in as non-copyable.
virtual ~Association()
Does nothing.
AssociatedObjectType * operator->() const