#include <FesaDeviceServer.h>
Public Member Functions | ||||
FesaDeviceServer (const std::string &name, const ProcessConfiguration *processConfiguration, SubscriptionTreeManager *subscriptionTreeManager) | ||||
Constructor. | ||||
~FesaDeviceServer () | ||||
Destructor. | ||||
rdaData * | get (const rdaIOPoint &iop, const rdaData &ctx) | |||
the get method is triggered by a client (over the middleware). If sucessfull, it will return the needed data package, otherwise it will throw an exception. | ||||
void | set (const rdaIOPoint &iop, const rdaData &ctx, const rdaData &value) | |||
the set method is triggered by a client (over the middleware). If sucessfull, it will write the value to the requested place. Otherwise it will throw an exception | ||||
void | monitorOn (const rdaIOPoint &iop, const rdaData &ctx, rdaValueChangeListener *listener) | |||
this method is triggered by a client (over the middleware), if he wants to subscribe to a speficied bundle of data | ||||
void | monitorOff (const rdaIOPoint &iop, rdaValueChangeListener *listener) | |||
this method is triggered by a client (over the middleware), if he wants to unsubscribe to a speficied bundle of data | ||||
void | start () | |||
bool | useFastUpdate () | |||
Static Public Member Functions | ||||
static void | initCMW () | |||
Private Member Functions | ||||
void | run () | |||
Implementation of the virtual method from Thread. | ||||
void | runDeviceServer () | |||
This method runs the RDADeviceServer.
| ||||
void | decodeIOPoint (const rdaIOPoint &iop, AbstractServerDeviceClass *&srvDeviceClass, Property *&prop, AbstractDevice *&device, std::string &cycleSelector) | |||
This method retrieves information about cycle selector, Property and Device from the IO-Point. | ||||
bool | isRTProcessDown () | |||
check if the RT part has crashed in the meanwhile | ||||
Private Attributes | ||||
SubscriptionTreeManager * | pTreeManager_ | |||
the SubscriptionTreeManager | ||||
bool | firstUpdateAcquisitionEnabled_ | |||
Flag to enable/diasable the firstUpdate procedure for Acquisition-Properties. | ||||
bool | firstUpdateSettingEnabled_ | |||
Flag to enable/diasable the firstUpdate procedure for Setting-Properties. | ||||
Mutex | mutex_ | |||
mutex to synchronize the shutdown | ||||
Friends | ||||
class | AbstractServerEquipment |
Definition at line 29 of file FesaDeviceServer.h.
fesa::FesaDeviceServer::FesaDeviceServer | ( | const std::string & | name, | |
const ProcessConfiguration * | processConfiguration, | |||
SubscriptionTreeManager * | subscriptionTreeManager | |||
) |
Constructor.
Definition at line 42 of file FesaDeviceServer.cpp.
References fesa::PropertyTag::FIRST_UPDATE_ACQUISITION, fesa::PropertyTag::FIRST_UPDATE_SETTING, firstUpdateAcquisitionEnabled_, firstUpdateSettingEnabled_, fesa::ProcessConfiguration::getBoolValue(), and fesa::ProcessConfiguration::getCMWConfigFile().
fesa::FesaDeviceServer::~FesaDeviceServer | ( | ) |
Destructor.
Definition at line 60 of file FesaDeviceServer.cpp.
References fesa::AbstractMutex::lock(), mutex_, and fesa::ProcessRunUtils::shutDown().
void fesa::FesaDeviceServer::decodeIOPoint | ( | const rdaIOPoint & | iop, | |
AbstractServerDeviceClass *& | srvDeviceClass, | |||
Property *& | prop, | |||
AbstractDevice *& | device, | |||
std::string & | cycleSelector | |||
) | [private] |
This method retrieves information about cycle selector, Property and Device from the IO-Point.
iop | The RDA IOPoint from the client | |
prop | give in a ref to | |
device | ||
cycleSelector |
Definition at line 279 of file FesaDeviceServer.cpp.
References FesaErrorDevicePropertyGlobalDevice, FesaErrorGlobalPropertyDeviceInstance, FesaErrorPropertyNotFound, FesaErrorUnknownDevice, fesa::AbstractDeviceFactory::getDevice(), fesa::AbstractServerEquipment::getDeviceClassFromDeviceName(), fesa::AbstractDeviceClass::getDeviceFactory(), fesa::AbstractDeviceFactory::getGlobalDevice(), fesa::AbstractServerEquipment::getInstance(), fesa::AbstractServerDeviceClass::getProperty(), and fesa::Property::isGlobal().
Referenced by get(), monitorOff(), monitorOn(), and set().
rdaData * fesa::FesaDeviceServer::get | ( | const rdaIOPoint & | iop, | |
const rdaData & | ctx | |||
) |
the get method is triggered by a client (over the middleware). If sucessfull, it will return the needed data package, otherwise it will throw an exception.
iop | inside this, the device, property and cycleSelector is stored | |
ctx | the filter |
This | function can throw rdaIOError |
Definition at line 105 of file FesaDeviceServer.cpp.
References decodeIOPoint(), fesa::ERROR_CATEGORY, FesaErrorRTProcessDown, fesa::DiagnosticUtils::framework, fesa::GET, fesa::AbstractEquipment::getDiagnostics(), fesa::FesaException::getErrorCodeAsLong(), fesa::AbstractEquipment::getInstance(), fesa::FesaException::getMessage(), isRTProcessDown(), fesa::DiagnosticUtils::DiagnosticMessage::msg, fesa::Thread::registerThreadIdName(), fesa::DiagnosticUtils::server, fesa::DiagnosticUtils::DiagnosticMessage::side, and fesa::DiagnosticUtils::DiagnosticMessage::source.
void fesa::FesaDeviceServer::initCMW | ( | ) | [static] |
Definition at line 374 of file FesaDeviceServer.cpp.
References FesaErrorInitializingRdaDeviceServerBase, fesa::ProcessConfiguration::getCMWConfigFile(), fesa::AbstractEquipment::getInstance(), and fesa::AbstractEquipment::getProcessConfiguration().
Referenced by fesa::AbstractServerEquipment::AbstractServerEquipment().
bool fesa::FesaDeviceServer::isRTProcessDown | ( | ) | [private] |
check if the RT part has crashed in the meanwhile
Definition at line 329 of file FesaDeviceServer.cpp.
References fesa::EquipmentData::getInstance(), fesa::EquipmentData::hasRt_, and fesa::EquipmentData::rtUp_.
Referenced by get(), monitorOn(), and set().
void fesa::FesaDeviceServer::monitorOff | ( | const rdaIOPoint & | iop, | |
rdaValueChangeListener * | listener | |||
) |
this method is triggered by a client (over the middleware), if he wants to unsubscribe to a speficied bundle of data
iop | inside this, the device, property and cycleSelector is stored | |
listener | The callback function, which is called, if new data arrives |
This | function can throw rdaIOError exceptions |
Definition at line 242 of file FesaDeviceServer.cpp.
References decodeIOPoint(), fesa::ERROR_CATEGORY, fesa::DiagnosticUtils::framework, fesa::AbstractEquipment::getDiagnostics(), fesa::FesaException::getErrorCodeAsLong(), fesa::AbstractEquipment::getInstance(), fesa::FesaException::getMessage(), fesa::DiagnosticUtils::DiagnosticMessage::msg, pTreeManager_, fesa::SubscriptionTreeManager::removeSubscriber(), fesa::DiagnosticUtils::server, fesa::DiagnosticUtils::DiagnosticMessage::side, and fesa::DiagnosticUtils::DiagnosticMessage::source.
void fesa::FesaDeviceServer::monitorOn | ( | const rdaIOPoint & | iop, | |
const rdaData & | ctx, | |||
rdaValueChangeListener * | listener | |||
) |
this method is triggered by a client (over the middleware), if he wants to subscribe to a speficied bundle of data
iop | inside this, the device, property and cycleSelector is stored | |
ctx | the filter | |
listener | The callback function, which is called, if new data arrives |
This | function can throw rdaIOError exceptions |
Definition at line 196 of file FesaDeviceServer.cpp.
References fesa::SubscriptionTreeManager::addSubscriber(), decodeIOPoint(), fesa::ERROR_CATEGORY, FesaErrorPropertySubscriptionDisabled, FesaErrorRTProcessDown, fesa::DiagnosticUtils::framework, fesa::AbstractEquipment::getDiagnostics(), fesa::FesaException::getErrorCodeAsLong(), fesa::EquipmentData::getInstance(), fesa::AbstractEquipment::getInstance(), fesa::FesaException::getMessage(), fesa::AbstractDeviceClass::getName(), isRTProcessDown(), fesa::DiagnosticUtils::DiagnosticMessage::msg, fesa::EquipmentData::notificationFailure_, pTreeManager_, fesa::DiagnosticUtils::server, fesa::DiagnosticUtils::DiagnosticMessage::side, fesa::DiagnosticUtils::DiagnosticMessage::source, and fesa::SUBSCRIBE.
void fesa::FesaDeviceServer::run | ( | ) | [private, virtual] |
Implementation of the virtual method from Thread.
Implements fesa::Thread.
Definition at line 352 of file FesaDeviceServer.cpp.
References FesaErrorIRunningDeviceServer, and runDeviceServer().
void fesa::FesaDeviceServer::runDeviceServer | ( | ) | [private] |
This method runs the RDADeviceServer.
This | function can throw different rdaInternalError and FesaExceptions. |
Definition at line 66 of file FesaDeviceServer.cpp.
References fesa::DiagnosticUtils::framework, fesa::AbstractEquipment::getDiagnostics(), fesa::AbstractEquipment::getInstance(), fesa::DiagnosticUtils::DiagnosticMessage::msg, mutex_, fesa::DiagnosticUtils::server, fesa::DiagnosticUtils::DiagnosticMessage::side, and fesa::DiagnosticUtils::DiagnosticMessage::source.
Referenced by run().
void fesa::FesaDeviceServer::set | ( | const rdaIOPoint & | iop, | |
const rdaData & | ctx, | |||
const rdaData & | value | |||
) |
the set method is triggered by a client (over the middleware). If sucessfull, it will write the value to the requested place. Otherwise it will throw an exception
iop | inside this, the device, property and cycleSelector is stored | |
ctx | the filter | |
value | the value, which has to be set |
This | function can throw rdaIOError exceptions |
Definition at line 153 of file FesaDeviceServer.cpp.
References decodeIOPoint(), fesa::ERROR_CATEGORY, FesaErrorRTProcessDown, fesa::DiagnosticUtils::framework, fesa::AbstractEquipment::getDiagnostics(), fesa::FesaException::getErrorCodeAsLong(), fesa::AbstractEquipment::getInstance(), fesa::FesaException::getMessage(), isRTProcessDown(), fesa::DiagnosticUtils::DiagnosticMessage::msg, fesa::Thread::registerThreadIdName(), fesa::DiagnosticUtils::server, fesa::DiagnosticUtils::DiagnosticMessage::side, and fesa::DiagnosticUtils::DiagnosticMessage::source.
void fesa::FesaDeviceServer::start | ( | ) |
Definition at line 339 of file FesaDeviceServer.cpp.
References fesa::AbstractEquipment::getDeviceDataFileName(), fesa::AbstractEquipment::getInstance(), fesa::AbstractEquipment::getProcessConfiguration(), and fesa::Thread::setPriority().
Referenced by fesa::AbstractServerEquipment::start().
bool fesa::FesaDeviceServer::useFastUpdate | ( | ) |
friend class AbstractServerEquipment [friend] |
Definition at line 109 of file FesaDeviceServer.h.
bool fesa::FesaDeviceServer::firstUpdateAcquisitionEnabled_ [private] |
Flag to enable/diasable the firstUpdate procedure for Acquisition-Properties.
Definition at line 124 of file FesaDeviceServer.h.
Referenced by FesaDeviceServer().
bool fesa::FesaDeviceServer::firstUpdateSettingEnabled_ [private] |
Flag to enable/diasable the firstUpdate procedure for Setting-Properties.
Definition at line 129 of file FesaDeviceServer.h.
Referenced by FesaDeviceServer().
Mutex fesa::FesaDeviceServer::mutex_ [private] |
mutex to synchronize the shutdown
Definition at line 134 of file FesaDeviceServer.h.
Referenced by runDeviceServer(), and ~FesaDeviceServer().
Definition at line 119 of file FesaDeviceServer.h.
Referenced by monitorOff(), and monitorOn().