FastArduino  v1.9 alpha
C++ library to build fast but small Arduino/AVR projects
lifecycle::DirectProxy< T > Class Template Reference

A kind of proxy class that encapsulates access to a fixed T instance. More...

#include <fastarduino/lifecycle.h>

Public Member Functions

 DirectProxy (const T &dest)
 Create a DirectProxy<T> to a static reference. More...
 
T * operator() (UNUSED const AbstractLifeCycleManager *manager=nullptr) const
 Return a pointer to the proxified T instance. More...
 
bool is_dynamic () const
 Tell if this DirectProxy is dynamic or static. More...
 
uint8_t id () const
 The identifier of the proxified LifeCycle<U> or 0 if a static instance was proxified. More...
 
T * destination () const
 A pointer to the static instance proxified.
 

Friends

bool operator== (const DirectProxy< T > &, const DirectProxy< T > &)
 
bool operator!= (const DirectProxy< T > &, const DirectProxy< T > &)
 

Detailed Description

template<typename T>
class lifecycle::DirectProxy< T >

A kind of proxy class that encapsulates access to a fixed T instance.

Each instance uses 2 bytes (pointer to the instance proxied). This class has the same API as LightProxy so it can be used in lieu of LightProxy.

Template Parameters
Tthe type of the object proxied
See also
LightProxy

Definition at line 825 of file lifecycle.h.

Constructor & Destructor Documentation

◆ DirectProxy()

template<typename T >
lifecycle::DirectProxy< T >::DirectProxy ( const T &  dest)
inline

Create a DirectProxy<T> to a static reference.

Parameters
destthe reference to a T instance to proxify.

Definition at line 832 of file lifecycle.h.

Member Function Documentation

◆ operator()()

template<typename T >
T* lifecycle::DirectProxy< T >::operator() ( UNUSED const AbstractLifeCycleManager manager = nullptr) const
inline

Return a pointer to the proxified T instance.

Parameters
managerunused, here to comply to LightProxy API, can be left to default nullptr.

Definition at line 856 of file lifecycle.h.

◆ is_dynamic()

template<typename T >
bool lifecycle::DirectProxy< T >::is_dynamic ( ) const
inline

Tell if this DirectProxy is dynamic or static.

Actually a DirectProxy is always static. This API exists to comply to LightProxy API.

Definition at line 866 of file lifecycle.h.

◆ id()

template<typename T >
uint8_t lifecycle::DirectProxy< T >::id ( ) const
inline

The identifier of the proxified LifeCycle<U> or 0 if a static instance was proxified.

This API actually always returns 0 and exists to comply to LightProxy API.

Definition at line 876 of file lifecycle.h.


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