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 | |
ProxyInterface () | |
~ProxyInterface () | |
template<typename DataType > | |
void | setProperty (const std::string &deviceName, const std::string &cycleSelector, DataType &property) |
template<typename DataType , typename FilterType > | |
void | setProperty (const std::string &deviceName, std::string &cycleSelector, DataType &property, FilterType &filter) |
template<typename DataType > | |
void | getProperty (const std::string &deviceName, const std::string &cycleSelector, DataType &property) |
template<typename DataType , typename FilterType > | |
void | getProperty (const std::string &deviceName, const std::string &cycleSelector, DataType &property, FilterType &filter) |
void | subscribe (const std::string &deviceName, const std::string &propertyName) |
void | subscribe (const std::string &deviceName, const std::string &propertyName, const std::string &cycleSelector) |
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 | waitNotification (std::string &deviceName, std::string &propertyName, std::string &cycleSelectorName, rdaData &value) |
Private Member Functions | |
rdaDeviceHandle * | getDeviceHandle (const std::string &deviceName) |
void | registerDevice (const std::string &deviceName) |
Private Attributes | |
rdaRDAService * | rda_ |
std::map< std::string, rdaDeviceHandle * > | rdaDeviceHandleCollection_ |
std::map< const std::string, rdaRequest * > | subscriptionCollection_ |
ProxyReplyHandler | replyHandler_ |
Friends | |
class | OnSubscriptionEventSource |
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.
Definition at line 26 of file ProxyInterface.h.
fesa::ProxyInterface::ProxyInterface | ( | ) |
Definition at line 11 of file ProxyInterface.cpp.
References rda_.
fesa::ProxyInterface::~ProxyInterface | ( | ) |
Definition at line 19 of file ProxyInterface.cpp.
References getDeviceHandle(), and subscriptionCollection_.
rdaDeviceHandle * fesa::ProxyInterface::getDeviceHandle | ( | const std::string & | deviceName | ) | [private] |
Definition at line 42 of file ProxyInterface.cpp.
References FesaErrorGettingRdaDeviceHandle, rda_, and rdaDeviceHandleCollection_.
Referenced by getProperty(), registerDevice(), setProperty(), subscribe(), unsubscribe(), and ~ProxyInterface().
void fesa::ProxyInterface::getProperty | ( | const std::string & | deviceName, | |
const std::string & | cycleSelector, | |||
DataType & | property, | |||
FilterType & | filter | |||
) | [inline] |
Definition at line 357 of file ProxyInterface.h.
References FesaErrorGettingRdaData, and getDeviceHandle().
void fesa::ProxyInterface::getProperty | ( | const std::string & | deviceName, | |
const std::string & | cycleSelector, | |||
DataType & | property | |||
) | [inline] |
Definition at line 342 of file ProxyInterface.h.
References FesaErrorGettingRdaData, and getDeviceHandle().
void fesa::ProxyInterface::registerDevice | ( | const std::string & | deviceName | ) | [private] |
Definition at line 37 of file ProxyInterface.cpp.
References getDeviceHandle().
void fesa::ProxyInterface::setProperty | ( | const std::string & | deviceName, | |
std::string & | cycleSelector, | |||
DataType & | property, | |||
FilterType & | filter | |||
) | [inline] |
Definition at line 294 of file ProxyInterface.h.
References FesaErrorSettingRdaData, and getDeviceHandle().
void fesa::ProxyInterface::setProperty | ( | const std::string & | deviceName, | |
const std::string & | cycleSelector, | |||
DataType & | property | |||
) | [inline] |
Definition at line 280 of file ProxyInterface.h.
References FesaErrorSettingRdaData, and getDeviceHandle().
void fesa::ProxyInterface::subscribe | ( | const std::string & | deviceName, | |
const std::string & | propertyName, | |||
const std::string & | cycleSelector | |||
) |
Definition at line 84 of file ProxyInterface.cpp.
References FesaErrorSubscribingProperty, getDeviceHandle(), replyHandler_, and subscriptionCollection_.
void fesa::ProxyInterface::subscribe | ( | const std::string & | deviceName, | |
const std::string & | propertyName | |||
) |
Definition at line 65 of file ProxyInterface.cpp.
References FesaErrorSubscribingProperty, getDeviceHandle(), replyHandler_, and subscriptionCollection_.
Referenced by fesa::OnSubscriptionEventSource::SubscriptionThread::run(), and fesa::OnSubscriptionEventSource::startSubscriptions().
void fesa::ProxyInterface::unsubscribe | ( | const std::string & | deviceName, | |
const std::string & | propertyName, | |||
const std::string & | cycleSelector | |||
) |
Definition at line 118 of file ProxyInterface.cpp.
References FesaErrorSubscribingProperty, getDeviceHandle(), and subscriptionCollection_.
void fesa::ProxyInterface::unsubscribe | ( | const std::string & | deviceName, | |
const std::string & | propertyName | |||
) |
Definition at line 104 of file ProxyInterface.cpp.
References FesaErrorSubscribingProperty, getDeviceHandle(), and subscriptionCollection_.
void fesa::ProxyInterface::waitNotification | ( | std::string & | deviceName, | |
std::string & | propertyName, | |||
std::string & | cycleSelectorName, | |||
rdaData & | value | |||
) |
Definition at line 133 of file ProxyInterface.cpp.
References replyHandler_, and fesa::ProxyReplyHandler::waitReply().
Referenced by fesa::OnSubscriptionEventSource::wait().
friend class OnSubscriptionEventSource [friend] |
Definition at line 243 of file ProxyInterface.h.
rdaRDAService* fesa::ProxyInterface::rda_ [private] |
Pointer to the RDA service. It provides the services of RDA
Definition at line 216 of file ProxyInterface.h.
Referenced by getDeviceHandle(), and ProxyInterface().
std::map<std::string, rdaDeviceHandle*> fesa::ProxyInterface::rdaDeviceHandleCollection_ [private] |
Collection of RDA device handlers. They establish the RDA communication entry point for each device
Definition at line 222 of file ProxyInterface.h.
Referenced by getDeviceHandle().
Callback object used by subscriptions
Definition at line 241 of file ProxyInterface.h.
Referenced by subscribe(), and waitNotification().
std::map<const std::string, rdaRequest*> fesa::ProxyInterface::subscriptionCollection_ [private] |
Collection of the subscription currently established. Each subscription is identified by the pair subscriptionEvent(deviceName:propertyName:cycleSelector) + rdaRequest object.
Definition at line 228 of file ProxyInterface.h.
Referenced by subscribe(), unsubscribe(), and ~ProxyInterface().