![]() |
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 () | |
TEnvelope & | operator= (const TEnvelope &src) |
TEnvelope & | operator= (T *letter) |
T * | operator-> () |
T & | operator* () |
T * | operator() () |
operator T* () | |
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
|
inlineexplicit |
Constructor for the envelope's letter object.
letter | Letter to wrap in the envelope. |
|
inline |
Copy constructor.
|
inlinenoexcept |
Move constructor.
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
TEnvelope< T > & sf::TEnvelope< T >::operator= | ( | const TEnvelope< T > & | src | ) |
TEnvelope< T > & sf::TEnvelope< T >::operator= | ( | T * | letter | ) |
|
inline |