![]() |
Scanframe Modular Application 0.1.0
|
Envelope-letter type of smart pointers. More...
#include <TEnvelope.h>
Public Member Functions | |
| TEnvelope (T *letter) | |
| Constructor for the envelope's letter object. | |
| TEnvelope (const TEnvelope &src) | |
| Copy constructor. | |
| TEnvelope (const TEnvelope &&src) noexcept | |
| Move constructor. | |
| ~TEnvelope () | |
| Destructor. | |
| TEnvelope & | operator= (const TEnvelope &src) |
| TEnvelope & | operator= (T *object) |
| operator bool () | |
| T * | operator-> () |
| T & | operator* () |
| T * | operator() () |
| T * | get () |
| const T * | get () const |
| operator T* () | |
| operator const T * () const | |
| int | referencedCount () const |
Envelope-letter type of smart pointers.
In this implementation the envelope acts as a smart pointer to a reference-counted internal letter. This allows a lot of flexibility & safety in working with a single object (associated with the letter) being assigned to numerous envelopes in many scopes. An 'A' version is provided for use with arrays. Use like: TEnvelope<T> e1 = new T(x,y,x); // e1 now owns a T in a letter e1->Func(); // invokes Func() on the new T Func(*e1); // passing a T& or a T this way TEnvelope<T> e2 = e1; // e2 safely shares the letter with e1
TAEnvelope<T> e1 = new T[99]; // e1 now owns T[] in a letter e1[i].Func(); // invokes Func() on a T element Func(e1[i]); // passing a T& or a T this way TAEnvelope<T> e2 = e1; // e2 safely shares the letter with e1
| sf::TEnvelope< T >::TEnvelope | ( | T * | letter | ) |
Constructor for the envelope's letter object.
| letter | Letter to wrap in the envelope. |
| sf::TEnvelope< T >::TEnvelope | ( | const TEnvelope< T > & | src | ) |
Copy constructor.
|
noexcept |
Move constructor.
| sf::TEnvelope< T >::~TEnvelope | ( | ) |
Destructor.
| T * sf::TEnvelope< T >::get | ( | ) |
| const T * sf::TEnvelope< T >::get | ( | ) | const |
| sf::TEnvelope< T >::operator bool | ( | ) |
|
explicit |
|
explicit |
| T * sf::TEnvelope< T >::operator() | ( | ) |
| T & sf::TEnvelope< T >::operator* | ( | ) |
| T * sf::TEnvelope< T >::operator-> | ( | ) |
| TEnvelope< T > & sf::TEnvelope< T >::operator= | ( | const TEnvelope< T > & | src | ) |
| TEnvelope< T > & sf::TEnvelope< T >::operator= | ( | T * | object | ) |
| int sf::TEnvelope< T >::referencedCount | ( | ) | const |