fesa-core  7.0.0
fesa::ProxyInterface Class Reference

Interface to access device properties with set, get or subscription calls. This class is meant to be used as the implementation of an association relationship between classes. It could be also used to establish association relationships between devices of the same class. Therefore a class can access a device of the same class or different class deployed on the same or on a different frontend. More...

#include <ProxyInterface.h>

Public Member Functions

template<typename DataType >
void setProperty (const std::string &deviceName, const std::string &cycleSelector, const DataType &property)
 Sets a property of a device. The template parameter admits a valid PropertyData type exported by a class. This call is blocking. More...
 
template<typename DataType , typename FilterType >
void setProperty (const std::string &deviceName, const std::string &cycleSelector, const DataType &property, const FilterType &filter)
 Sets a property of a device The template parameter admits a valid PropertyData type exported by a class. This call is blocking. More...
 
template<typename DataType >
std::auto_ptr< DataType > getProperty (const std::string &deviceName, const std::string &cycleSelector)
 Gets a property from a device The template parameter admits a valid PropertyData type exported by a class. This call is blocking. More...
 
template<typename DataType , typename FilterType >
std::auto_ptr< DataType > getProperty (const std::string &deviceName, const std::string &cycleSelector, const FilterType &filter)
 Gets a property from a device. The template parameter admits a valid PropertyData type exported by a class. This call is blocking. More...
 
template<typename DataType >
std::auto_ptr< DataType > timedGetProperty (const std::string &deviceName, const std::string &cycleSelector, std::time_t timeoutSec, std::time_t timeoutNanoSec, bool &timedOut)
 Gets a property from a device. Returns after the get is done (successful or not) or a given period of time has elapsed, whichever comes first. The template parameter admits a valid PropertyData type exported by a class. This call is blocking. More...
 
template<typename DataType , typename FilterType >
std::auto_ptr< DataType > timedGetProperty (const std::string &deviceName, const std::string &cycleSelector, const FilterType &filter, std::time_t timeoutSec, std::time_t timeoutNanoSec, bool &timedOut)
 Gets a property from a device. Returns after the get is done (successful or not) or a given period of time has elapsed, whichever comes first. The template parameter admits a valid PropertyData type exported by a class. This call is blocking. More...
 
void subscribe (const std::string &deviceName, const std::string &propertyName)
 Send a request for a new subscription. More...
 
void subscribe (const std::string &deviceName, const std::string &propertyName, const std::string &cycleSelector)
 Send a request for a new subscription. More...
 
void subscribe (const std::string &deviceName, const std::string &propertyName, const ServerData &filter)
 
void subscribe (const std::string &deviceName, const std::string &propertyName, const std::string &cycleSelector, const ServerData &filter)
 
void unsubscribe (const std::string &deviceName, const std::string &propertyName)
 
void unsubscribe (const std::string &deviceName, const std::string &propertyName, const std::string &cycleSelector)
 
void unsubscribe (const std::string &deviceName, const std::string &propertyName, const ServerData &filter)
 
void unsubscribe (const std::string &deviceName, const std::string &propertyName, const std::string &cycleSelector, const ServerData &filter)
 
std::auto_ptr< PropertyDatawaitNotification (std::string &deviceName, std::string &propertyName)
 Blocks until a notification is received on any of the subscribed device/property. More...
 

Detailed Description

Interface to access device properties with set, get or subscription calls. This class is meant to be used as the implementation of an association relationship between classes. It could be also used to establish association relationships between devices of the same class. Therefore a class can access a device of the same class or different class deployed on the same or on a different frontend.

Member Function Documentation

template<typename DataType >
std::auto_ptr< DataType > fesa::ProxyInterface::getProperty ( const std::string &  deviceName,
const std::string &  cycleSelector 
)

Gets a property from a device The template parameter admits a valid PropertyData type exported by a class. This call is blocking.

Template Parameters
DataTypethe data type of the property
Parameters
deviceNameName of the device
cycleSelectorthe cycle selector to use
Returns
the value of the property
Exceptions
FesaException
template<typename DataType , typename FilterType >
std::auto_ptr< DataType > fesa::ProxyInterface::getProperty ( const std::string &  deviceName,
const std::string &  cycleSelector,
const FilterType &  filter 
)

Gets a property from a device. The template parameter admits a valid PropertyData type exported by a class. This call is blocking.

Template Parameters
DataTypethe data type of the property
Parameters
deviceNameName of the device
cycleSelectorThe cycle identifier
filterFilter for the data
Returns
the value of the property
Exceptions
FesaException
template<typename DataType >
void fesa::ProxyInterface::setProperty ( const std::string &  deviceName,
const std::string &  cycleSelector,
const DataType &  property 
)

Sets a property of a device. The template parameter admits a valid PropertyData type exported by a class. This call is blocking.

Template Parameters
DataTypethe data type of the property
Parameters
deviceNamethe name of the device
cycleSelectorthe cycle selector to use
propertythe data to be sent
Exceptions
FesaException
template<typename DataType , typename FilterType >
void fesa::ProxyInterface::setProperty ( const std::string &  deviceName,
const std::string &  cycleSelector,
const DataType &  property,
const FilterType &  filter 
)

Sets a property of a device The template parameter admits a valid PropertyData type exported by a class. This call is blocking.

Template Parameters
DataTypethe data type of the property
FilterTypethe filter type of the property
Parameters
deviceNameName of the device
cycleSelectorthe cycle selector to use
propertyThe data to be sent
filterFilter for the data
Exceptions
FesaException
void fesa::ProxyInterface::subscribe ( const std::string &  deviceName,
const std::string &  propertyName 
)

Send a request for a new subscription.

Parameters
deviceNameName of the device to subscribe to
propertyNameName of the property to subscribe to
Exceptions
FesaException
void fesa::ProxyInterface::subscribe ( const std::string &  deviceName,
const std::string &  propertyName,
const std::string &  cycleSelector 
)

Send a request for a new subscription.

Parameters
deviceNameName of the device to subscribe to
propertyNameName of the property to subscribe to
cycleSelectorName of the cycle
Exceptions
FesaException
void fesa::ProxyInterface::subscribe ( const std::string &  deviceName,
const std::string &  propertyName,
const ServerData filter 
)

Sends a request for a new subscription, with a filter item. Uses an empty cycle selector.

Parameters
deviceNameName of the device to subscribe to
propertyNameName of the property to subscribe to
filterfilter data to use
Exceptions
FesaException
void fesa::ProxyInterface::subscribe ( const std::string &  deviceName,
const std::string &  propertyName,
const std::string &  cycleSelector,
const ServerData filter 
)

Sends a request for a new subscription, with a filter item.

Parameters
deviceNameName of the device to subscribe to
propertyNameName of the property to subscribe to
cycleSelectorName of the cycle
filterfilter data to use
Exceptions
FesaException
template<typename DataType >
std::auto_ptr< DataType > fesa::ProxyInterface::timedGetProperty ( const std::string &  deviceName,
const std::string &  cycleSelector,
std::time_t  timeoutSec,
std::time_t  timeoutNanoSec,
bool &  timedOut 
)

Gets a property from a device. Returns after the get is done (successful or not) or a given period of time has elapsed, whichever comes first. The template parameter admits a valid PropertyData type exported by a class. This call is blocking.

Template Parameters
DataTypethe data type of the property
Parameters
deviceNameName of the device
cycleSelectorthe cycle selector to use
timeoutSecnumber of seconds before timeout
timeoutNanoSecnumber of nanoseconds before timeout
[out]timedOutset to true if the timeout elapsed before the get completed
Returns
the value of the property
Exceptions
FesaException
template<typename DataType , typename FilterType >
std::auto_ptr< DataType > fesa::ProxyInterface::timedGetProperty ( const std::string &  deviceName,
const std::string &  cycleSelector,
const FilterType &  filter,
std::time_t  timeoutSec,
std::time_t  timeoutNanoSec,
bool &  timedOut 
)

Gets a property from a device. Returns after the get is done (successful or not) or a given period of time has elapsed, whichever comes first. The template parameter admits a valid PropertyData type exported by a class. This call is blocking.

Template Parameters
DataTypethe data type of the property
Parameters
deviceNameName of the device
cycleSelectorThe cycle identifier
filterFilter for the data
timeoutSecnumber of seconds before timeout
timeoutNanoSecnumber of nanoseconds before timeout
[out]timedOutset to true if the timeout elapsed before the get completed
Returns
the value of the property
Exceptions
FesaException
void fesa::ProxyInterface::unsubscribe ( const std::string &  deviceName,
const std::string &  propertyName 
)

Cancels an existing subscription.

Parameters
deviceNamename of the device
propertyNamename of the property
Exceptions
FesaExceptionif there is no such subscription or if an error happens when unsubscribing
void fesa::ProxyInterface::unsubscribe ( const std::string &  deviceName,
const std::string &  propertyName,
const std::string &  cycleSelector 
)

Cancels an existing subscription.

Parameters
deviceNamename of the device
propertyNamename of the property
cycleSelectorcycle selector of the subscription
Exceptions
FesaExceptionif there is no such subscription or if an error happens when unsubscribing
void fesa::ProxyInterface::unsubscribe ( const std::string &  deviceName,
const std::string &  propertyName,
const ServerData filter 
)

Cancels an existing subscription.

Parameters
deviceNamename of the device
propertyNamename of the property
filterfilter data that was used to subscribe
Exceptions
FesaExceptionif there is no such subscription or if an error happens when unsubscribing
void fesa::ProxyInterface::unsubscribe ( const std::string &  deviceName,
const std::string &  propertyName,
const std::string &  cycleSelector,
const ServerData filter 
)

Cancels an existing subscription.

Parameters
deviceNamename of the device
propertyNamename of the property
cycleSelectorcycle selector of the subscription
filterfilter data that was used to subscribe
Exceptions
FesaExceptionif there is no such subscription or if an error happens when unsubscribing
std::auto_ptr< PropertyData > fesa::ProxyInterface::waitNotification ( std::string &  deviceName,
std::string &  propertyName 
)

Blocks until a notification is received on any of the subscribed device/property.

Parameters
[out]deviceNamename of the device on which a notification was received
[out]propertyNamename of the property on which a notification was received
Returns
the data of the notification

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