Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::TEnvelope< T > Class Template Reference

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 ()
 
TEnvelopeoperator= (const TEnvelope &src)
 
TEnvelopeoperator= (T *letter)
 
T * operator-> ()
 
T & operator* ()
 
T * operator() ()
 
 operator T* ()
 
int referencedCount () const
 

Detailed Description

template<typename T>
class sf::TEnvelope< T >

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

Constructor & Destructor Documentation

◆ TEnvelope() [1/3]

template<typename T >
sf::TEnvelope< T >::TEnvelope ( T *  letter)
inlineexplicit

Constructor for the envelope's letter object.

Parameters
letterLetter to wrap in the envelope.

◆ TEnvelope() [2/3]

template<typename T >
sf::TEnvelope< T >::TEnvelope ( const TEnvelope< T > &  src)
inline

Copy constructor.

◆ TEnvelope() [3/3]

template<typename T >
sf::TEnvelope< T >::TEnvelope ( const TEnvelope< T > &&  src)
inlinenoexcept

Move constructor.

◆ ~TEnvelope()

template<typename T >
sf::TEnvelope< T >::~TEnvelope ( )
inline

Member Function Documentation

◆ operator T*()

template<typename T >
sf::TEnvelope< T >::operator T* ( )
inlineexplicit

◆ operator()()

template<typename T >
T * sf::TEnvelope< T >::operator() ( )
inline

◆ operator*()

template<typename T >
T & sf::TEnvelope< T >::operator* ( )
inline

◆ operator->()

template<typename T >
T * sf::TEnvelope< T >::operator-> ( )
inline

◆ operator=() [1/2]

template<typename T >
TEnvelope< T > & sf::TEnvelope< T >::operator= ( const TEnvelope< T > &  src)

◆ operator=() [2/2]

template<typename T >
TEnvelope< T > & sf::TEnvelope< T >::operator= ( T *  letter)

◆ referencedCount()

template<typename T >
int sf::TEnvelope< T >::referencedCount ( ) const
inline

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