fesa-core
4.3.1
|
This class represents a property which computes through server actions the value of a requested attribute. More...
#include <Property.h>
Public Member Functions | |
Property (const PropertyConstructorParameters ¶meters, AbstractServerAction *getServerAction, AbstractServerAction *setServerAction) | |
Constructor. More... | |
virtual | ~Property () |
Destructor. | |
template<typename PropDataType , typename PropFilterType > | |
std::auto_ptr< PropDataType > | get (AbstractDevice &device, const std::string &cyleSelector, const PropFilterType &filter) |
Template method that returns the value of a property This method is meant to be used by the developer to call a property without using the RDA data but using the real data type of the user's property. More... | |
template<typename PropDataType > | |
std::auto_ptr< PropDataType > | get (AbstractDevice &device, const std::string &cyleSelector) |
Template method that returns the value of a property This method is meant to be used by the developer to call a property without using the RDA data but using the real data type of the user's property. More... | |
std::auto_ptr< PropertyData > | get (AbstractDevice &device, const MultiplexingContext &context) |
Return the data of the property. To be used by property data exporters. More... | |
template<typename PropDataType , typename PropFilterType > | |
__attribute__ ((deprecated)) void get(AbstractDevice &device | |
Template method that returns the value of a property This method is meant to be used by the developer to call a property without using the RDA data but using the real data type of the user's property. More... | |
template<typename PropDataType > | |
__attribute__ ((deprecated)) void get(AbstractDevice &device | |
Template method that returns the value of a property This method is meant to be used by the developer to call a property without using the RDA data but using the real data type of the user's property. More... | |
template<typename PropDataType , typename PropFilterType > | |
void | set (AbstractDevice &dev, const std::string &cyleSelector, const PropDataType &data, const PropFilterType &filter) |
This method modifies the value of the property. More... | |
template<typename PropDataType > | |
void | set (AbstractDevice &dev, const std::string &cyleSelector, const PropDataType &data) |
This method modifies the value of the property. More... | |
bool | hasDataChanged (const MultiplexingContext &context, AbstractDevice &device, const cmw::data::Data &filter) |
Check if the data published by this property changed This method will be called to decide whether a notification needs to be sent or not. More... | |
void | validateParameters (const AbstractDevice &dev, const Selector &cycleSelector, bool hasFilter, const RequestType::RequestType requestType) const |
This method validates the request to the property throwing an exception in case it is not correct. More... | |
const std::string & | getName () const |
get name of the property More... | |
PropertyType::PropertyType | getType () const |
the type of the property (Acquisition/Setting) More... | |
bool | isAcquisition () const |
bool | isGlobal () const |
to know if the property is global More... | |
bool | isMultiplexed () const |
bool | isSetting () const |
bool | isAccessPointMultiplexed (const AbstractDevice &device) const |
Returns true if the access point represented by this property is multiplexed on the given device. An access point is the instantiation of this property on a device. This method returns true if the property and the device are both multiplexed, false otherwise. More... | |
bool | isSubscribable () const |
virtual void | printConfig (FesaStream *configStream) const |
this method prints the property configuration into the stream passed by argument More... | |
virtual void | printState (FesaStream *fesaStream, double elapsedTime) const |
this method prints the actual state of the property (frequency of the completed actions) into the stream passed by argument More... | |
const std::string & | getNotificationThreadKey () const |
this method generates an Listener error for all underliing subscribers More... | |
Protected Member Functions | |
std::auto_ptr< PropertyData > | getInternal (AbstractDevice &device, const MultiplexingContext &context, const cmw::data::Data &filter) |
This method returns the value of a property for a specific context. More... | |
std::auto_ptr< PropertyData > | getInternal (AbstractDevice &device, const Selector &cycleSelector, const cmw::data::Data &filter) |
This method returns the value of a property for a cycle selector. More... | |
void | setInternal (AbstractDevice &device, const Selector &cycleSelector, const cmw::data::Data &filter, const PropertyData &value) |
This method modifies the value of the property for a selector. More... | |
virtual void | validateCycleSelector (const AbstractDevice &device, const Selector &cycleSelector, RequestType::RequestType reqType) const |
Validates a cycle selector. Throws an exception if the selector is invalid. More... | |
bool | hasDataChanged (const RequestEvent &event, AbstractDevice &device, const cmw::data::Data &filter) |
Check if the data published by this property changed This method will be called to decide whether a notification needs to be sent or not. More... | |
bool | needFilter () const |
true if the property needs a filter | |
Protected Attributes | |
std::string | name_ |
name of the property | |
bool | isGlobal_ |
true if the property is global | |
bool | isSubscribable_ |
true if the property supports subscription | |
PropertyType::PropertyType | type_ |
indicates if the property is an acquisition or setting property | |
bool | multiplexed_ |
std::string | notificationThreadKey_ |
the notification thread key associated to this property. This value is taken from teh code-generation and identifies the thread where all teh notification for this property will run | |
AbstractServerAction * | getServerAction_ |
server action to get the value of the property | |
AbstractServerAction * | setServerAction_ |
server action to set the value of the property | |
std::string | className_ |
name of the class the property belongs to | |
This class represents a property which computes through server actions the value of a requested attribute.
fesa::Property::Property | ( | const PropertyConstructorParameters & | parameters, |
AbstractServerAction * | getServerAction, | ||
AbstractServerAction * | setServerAction | ||
) |
Constructor.
parameters | contains all mandatory parameters of the property |
getServerAction | with the pointer to the server action that will be executed to get the value for the property (NULL if not used) |
setServerAction | with the pointer to the server action that will be executed to set the value for the property (NULL if not used) |
fesa::Property::__attribute__ | ( | (deprecated) | ) |
Template method that returns the value of a property This method is meant to be used by the developer to call a property without using the RDA data but using the real data type of the user's property.
PropDataType | Type of the data, as it is defined in the custom class |
PropFilterType | Type of the filter, as it is defined in the custom class |
device | the device we want to access | |
cyleSelector | cycle for which the value of the property will be retrieved | |
[out] | value | data containing the value of the property |
This | function can throw different FesaExceptions |
fesa::Property::__attribute__ | ( | (deprecated) | ) |
Template method that returns the value of a property This method is meant to be used by the developer to call a property without using the RDA data but using the real data type of the user's property.
PropDataType | Type of the data, as it is defined in the custom class |
device | the device we want to access | |
cyleSelector | cycle for which the value of the property will be retrieved | |
[out] | value | data containing the value of the property |
This | function can throw different FesaExceptions |
std::auto_ptr< PropDataType > fesa::Property::get | ( | AbstractDevice & | device, |
const std::string & | cyleSelector, | ||
const PropFilterType & | filter | ||
) |
Template method that returns the value of a property This method is meant to be used by the developer to call a property without using the RDA data but using the real data type of the user's property.
PropDataType | Type of the data, as it is defined in the custom class |
PropFilterType | Type of the filter, as it is defined in the custom class |
device | the device we want to access |
cyleSelector | cycle for which the value of the property will be retrieved |
filter | data containing the filter of the property |
This | function can throw different FesaExceptions |
std::auto_ptr< PropDataType > fesa::Property::get | ( | AbstractDevice & | device, |
const std::string & | cyleSelector | ||
) |
Template method that returns the value of a property This method is meant to be used by the developer to call a property without using the RDA data but using the real data type of the user's property.
PropDataType | Type of the data, as it is defined in the custom class |
device | the device we want to access |
cyleSelector | cycle for which the value of the property will be retrieved |
This | function can throw different FesaExceptions |
std::auto_ptr< PropertyData > fesa::Property::get | ( | AbstractDevice & | device, |
const MultiplexingContext & | context | ||
) |
Return the data of the property. To be used by property data exporters.
device | The device for which the data of the property to be taken |
context | The context for which the data of the property to be taken |
FesaException |
|
protected |
This method returns the value of a property for a specific context.
device | device we want to access |
context | context for which we want the value of the property |
filter | RDA data containing the filter of the property |
This | function can throw different FesaExceptions |
|
protected |
This method returns the value of a property for a cycle selector.
device | device we want to access |
cycleSelector | cycle for which the value of the property will be retrieved |
filter | RDA data containing the filter of the property |
|
inline |
get name of the property
const std::string & fesa::Property::getNotificationThreadKey | ( | ) | const |
this method generates an Listener error for all underliing subscribers
Messsage | The error message |
|
inline |
the type of the property (Acquisition/Setting)
bool fesa::Property::hasDataChanged | ( | const MultiplexingContext & | context, |
AbstractDevice & | device, | ||
const cmw::data::Data & | filter | ||
) |
Check if the data published by this property changed This method will be called to decide whether a notification needs to be sent or not.
context | The context to use |
device | The device this property belongs to |
filter | The data filter |
|
protected |
Check if the data published by this property changed This method will be called to decide whether a notification needs to be sent or not.
event | The request event that triggered this server action |
device | The device this property belongs to |
filter | The data filter |
bool fesa::Property::isAccessPointMultiplexed | ( | const AbstractDevice & | device | ) | const |
Returns true if the access point represented by this property is multiplexed on the given device. An access point is the instantiation of this property on a device. This method returns true if the property and the device are both multiplexed, false otherwise.
|
inline |
|
inline |
to know if the property is global
|
inline |
|
inline |
|
inline |
|
virtual |
this method prints the property configuration into the stream passed by argument
configStream | in which the information will be printed |
|
virtual |
this method prints the actual state of the property (frequency of the completed actions) into the stream passed by argument
fesaStream | in which the information will be printed |
void fesa::Property::set | ( | AbstractDevice & | dev, |
const std::string & | cyleSelector, | ||
const PropDataType & | data, | ||
const PropFilterType & | filter | ||
) |
This method modifies the value of the property.
dev | device we want to access |
cycleSelector | cycle for which the value of the property will be retrieved |
data | value to set |
filter | data containing the filter of the property |
This | function can throw different FesaExceptions |
void fesa::Property::set | ( | AbstractDevice & | dev, |
const std::string & | cyleSelector, | ||
const PropDataType & | data | ||
) |
This method modifies the value of the property.
dev | device we want to access |
cycleSelector | cycle for which the value of the property will be retrieved |
data | value to set |
This | function can throw different FesaExceptions |
|
protected |
This method modifies the value of the property for a selector.
device | device we want to access |
cycleSelector | cycle for which the property will be set (ignored if the property is not multiplexed) |
filter | RDA data containing the filter of the property |
value | PropertyData containing the value to set |
This | function can throw different FesaExceptions |
|
protectedvirtual |
Validates a cycle selector. Throws an exception if the selector is invalid.
device | The device on which the operation (get/set/monitor) is done |
cycleSelector | to be checked |
reqType | The type of request |
FesaException | indicating the reason why the selector is refused |
void fesa::Property::validateParameters | ( | const AbstractDevice & | dev, |
const Selector & | cycleSelector, | ||
bool | hasFilter, | ||
const RequestType::RequestType | requestType | ||
) | const |
This method validates the request to the property throwing an exception in case it is not correct.
dev | device |
cycleSelector | |
hasFilter | true if the property has filter |
requestType | the type of request |
|
protected |
multiplexing Criterion of the property