Carna Version 3.3.3
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Related Symbols | List of all members
Carna::base::Association< AssociatedObjectType > Class Template Reference

Represents an association. More...

#include <Association.h>

+ Inheritance diagram for Carna::base::Association< AssociatedObjectType >:

Public Member Functions

virtual ~Association ()
 Does nothing.
 
AssociatedObjectTypeget () const
 Returns raw pointer to the referenced object.
 
AssociatedObjectTypeoperator-> () const
 
AssociatedObjectTypeoperator* () 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.
 

Protected Member Functions

 Association (AssociatedObjectType *associatedObject=nullptr)
 Instantiates.
 

Related Symbols

(Note that these are not member symbols.)

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.
 

Detailed Description

template<typename AssociatedObjectType>
class Carna::base::Association< AssociatedObjectType >

Represents an association.

By using this class it is possible to let the user of some software module decide whether he wants to pass the ownership of some object to that module or not.

Author
Leonid Kostrykin
Date
26.10.11 - 17.3.15

Definition at line 44 of file Association.h.

Constructor & Destructor Documentation

◆ ~Association()

Does nothing.

Definition at line 54 of file Association.h.

◆ Association()

Carna::base::Association< AssociatedObjectType >::Association ( AssociatedObjectType associatedObject = nullptr)
inlineexplicitprotected

Instantiates.

Definition at line 105 of file Association.h.

Member Function Documentation

◆ forget()

Makes this association forget it's referenced object.

Using this method it is possible to bypass the default behavior of the association when it is released.

Definition at line 95 of file Association.h.

◆ get()

Returns raw pointer to the referenced object.

Definition at line 61 of file Association.h.

◆ operator bool()

Tells whether any object is referenced by this association.

Definition at line 84 of file Association.h.

◆ operator*()

Returns raw reference to the referenced object.

Definition at line 76 of file Association.h.

◆ operator->()

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 68 of file Association.h.

Friends And Related Symbol Documentation

◆ operator==()

Tells whether l and r do reference the same object, that may be nullptr.

Definition at line 130 of file Association.h.


The documentation for this class was generated from the following file: