fesa-core
5.0.1
|
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< PropertyData > | waitNotification (std::string &deviceName, std::string &propertyName) |
Blocks until a notification is received. More... | |
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.
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.
DataType | the data type of the property |
deviceName | Name of the device |
cycleSelector | the cycle selector to use |
FesaException |
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.
DataType | the data type of the property |
deviceName | Name of the device |
cycleSelector | The cycle identifier |
filter | Filter for the data |
FesaException |
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.
DataType | the data type of the property |
deviceName | the name of the device |
cycleSelector | the cycle selector to use |
property | the data to be sent |
FesaException |
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.
DataType | the data type of the property |
FilterType | the filter type of the property |
deviceName | Name of the device |
cycleSelector | the cycle selector to use |
property | The data to be sent |
filter | Filter for the data |
FesaException |
void fesa::ProxyInterface::subscribe | ( | const std::string & | deviceName, |
const std::string & | propertyName | ||
) |
Send a request for a new subscription.
deviceName | Name of the device to subscribe to |
propertyName | Name of the property to subscribe to |
FesaException |
void fesa::ProxyInterface::subscribe | ( | const std::string & | deviceName, |
const std::string & | propertyName, | ||
const std::string & | cycleSelector | ||
) |
Send a request for a new subscription.
deviceName | Name of the device to subscribe to |
propertyName | Name of the property to subscribe to |
cycleSelector | Name of the cycle |
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.
deviceName | Name of the device to subscribe to |
propertyName | Name of the property to subscribe to |
filter | filter data to use |
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.
deviceName | Name of the device to subscribe to |
propertyName | Name of the property to subscribe to |
cycleSelector | Name of the cycle |
filter | filter data to use |
FesaException |
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.
DataType | the data type of the property |
deviceName | Name of the device | |
cycleSelector | the cycle selector to use | |
timeoutSec | number of seconds before timeout | |
timeoutNanoSec | number of nanoseconds before timeout | |
[out] | timedOut | set to true if the timeout elapsed before the get completed |
FesaException |
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.
DataType | the data type of the property |
deviceName | Name of the device | |
cycleSelector | The cycle identifier | |
filter | Filter for the data | |
timeoutSec | number of seconds before timeout | |
timeoutNanoSec | number of nanoseconds before timeout | |
[out] | timedOut | set to true if the timeout elapsed before the get completed |
FesaException |
void fesa::ProxyInterface::unsubscribe | ( | const std::string & | deviceName, |
const std::string & | propertyName | ||
) |
Cancels an existing subscription.
deviceName | name of the device |
propertyName | name of the property |
FesaException | if 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.
deviceName | name of the device |
propertyName | name of the property |
cycleSelector | cycle selector of the subscription |
FesaException | if 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.
deviceName | name of the device |
propertyName | name of the property |
filter | filter data that was used to subscribe |
FesaException | if 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.
deviceName | name of the device |
propertyName | name of the property |
cycleSelector | cycle selector of the subscription |
filter | filter data that was used to subscribe |
FesaException | if 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.
[out] | deviceName | name of the device on which a notification was received |
[out] | propertyName | name of the property on which a notification was received |