Caffa  1.1.0
C++ Application Framework for Embedded Systems with introspection
Public Member Functions | List of all members
caffa::DataFieldAccessor< DataType > Class Template Referenceabstract

Abstract but typed data field accessor. Inherit to create different storage mechanisms. More...

#include <cafDataFieldAccessor.h>

Inheritance diagram for caffa::DataFieldAccessor< DataType >:
Inheritance graph
[legend]
Collaboration diagram for caffa::DataFieldAccessor< DataType >:
Collaboration graph
[legend]

Public Member Functions

virtual std::unique_ptr< DataFieldAccessor< DataType > > clone () const =0
 Clone the accessor using polymorphism. More...
 
virtual DataType value ()=0
 Get the field value. More...
 
virtual void setValue (const DataType &value)=0
 Set the value with the accessor. Will throw a std::runtime_exception if the accessor has limits and the value is outside those limits. More...
 
virtual bool hasSetter () const =0
 
virtual bool hasGetter () const =0
 

Detailed Description

template<class DataType>
class caffa::DataFieldAccessor< DataType >

Abstract but typed data field accessor. Inherit to create different storage mechanisms.

Template Parameters
DataType

Member Function Documentation

◆ clone()

template<class DataType >
virtual std::unique_ptr<DataFieldAccessor<DataType> > caffa::DataFieldAccessor< DataType >::clone ( ) const
pure virtual

Clone the accessor using polymorphism.

Returns
A unique pointer to object of implementation class.

Implemented in caffa::DataFieldDirectStorageAccessor< DataType >, caffa::FieldProxyAccessor< DataType >, and caffa::rpc::DataFieldAccessor< DataType >.

◆ hasGetter()

template<class DataType >
virtual bool caffa::DataFieldAccessor< DataType >::hasGetter ( ) const
pure virtual

The accessor has a setter. Thus can be written to.

Returns
true if it has a setter

Implemented in caffa::DataFieldDirectStorageAccessor< DataType >, caffa::FieldProxyAccessor< DataType >, and caffa::rpc::DataFieldAccessor< DataType >.

◆ hasSetter()

template<class DataType >
virtual bool caffa::DataFieldAccessor< DataType >::hasSetter ( ) const
pure virtual

The accessor has a getter. Thus can be read.

Returns
true if it has a getter

Implemented in caffa::DataFieldDirectStorageAccessor< DataType >, caffa::FieldProxyAccessor< DataType >, and caffa::rpc::DataFieldAccessor< DataType >.

◆ setValue()

template<class DataType >
virtual void caffa::DataFieldAccessor< DataType >::setValue ( const DataType &  value)
pure virtual

Set the value with the accessor. Will throw a std::runtime_exception if the accessor has limits and the value is outside those limits.

Parameters
valueThe value to set

Implemented in caffa::DataFieldDirectStorageAccessor< DataType >, caffa::FieldProxyAccessor< DataType >, and caffa::rpc::DataFieldAccessor< DataType >.

◆ value()

template<class DataType >
virtual DataType caffa::DataFieldAccessor< DataType >::value ( )
pure virtual

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