Tango Core Classes Reference
9.3.3
|
There is one instance of this class for each device. More...
#include "tango.h"
Public Member Functions | |
Constructor | |
Only one constructor is defined for this class | |
MultiAttribute (string &dev_name, DeviceClass *dev_class, DeviceImpl *dev) | |
Create a new MultiAttribute object. More... | |
Destructor | |
Only one desctructor is defined for this class | |
~MultiAttribute () | |
The MultiAttribute desctructor. | |
Miscellaneous methods | |
Attribute & | get_attr_by_name (const char *attr_name) |
Get Attribute object from its name. More... | |
Attribute & | get_attr_by_ind (const long ind) |
Get Attribute object from its index. More... | |
WAttribute & | get_w_attr_by_name (const char *attr_name) |
Get Writable Attribute object from its name. More... | |
WAttribute & | get_w_attr_by_ind (const long ind) |
Get Writable Attribute object from its index. More... | |
long | get_attr_ind_by_name (const char *attr_name) |
Get Attribute index into the main attribute vector from its name. More... | |
vector< long > & | get_alarm_list () |
Get list of attribute with an alarm level defined. More... | |
unsigned long | get_attr_nb () |
Get attribute number. More... | |
bool | check_alarm (const char *attr_name) |
Check alarm for one attribute with a given name. More... | |
bool | check_alarm (const long ind) |
Check alarm for one attribute from its index in the main attributes vector. More... | |
bool | check_alarm () |
Check alarm on all attribute(s) with an alarm defined. More... | |
void | read_alarm (string &status) |
Add alarm message to device status. More... | |
vector< Attribute * > & | get_attribute_list () |
Get the vector of attribute objects. More... | |
Protected Attributes | |
Class data members | |
vector< Attribute * > | attr_list |
The Attribute objects vector. More... | |
vector< long > | writable_attr_list |
The list of writable attribute. More... | |
vector< long > | alarm_attr_list |
The list of attribute with an alarm level defined. More... | |
There is one instance of this class for each device.
This class is mainly an aggregate of Attribute or WAttribute objects. It eases management of multiple attributes
$Author$ $Revision$
Tango::MultiAttribute::MultiAttribute | ( | string & | dev_name, |
DeviceClass * | dev_class, | ||
DeviceImpl * | dev | ||
) |
Create a new MultiAttribute object.
This constructor will in-turn call the constructor of the Attribute or WAttribute class of all the device class attributes.
dev_name | The device name |
dev_class | Reference to the device DeviceClass object |
dev | The device pointer |
DevFailed | If the command sent to the database failed. Click here to read DevFailed exception specification |
bool Tango::MultiAttribute::check_alarm | ( | ) |
Check alarm on all attribute(s) with an alarm defined.
This method returns a boolean set to true if one of the attribute with an alarm level defined is in alarm condition.
DevFailed | If the alarm level are not defined for one of the attribute in the list of alarmable one Click here to read DevFailed exception specification |
|
inline |
Check alarm for one attribute with a given name.
This method returns a boolean set to true if the attribute with the given name is in alarm condition
attr_name | The attribute name |
DevFailed | If the attribute does not have any alarm level defined. Click here to read DevFailed exception specification |
References Tango::Attribute::check_alarm(), and get_attr_by_name().
|
inline |
Check alarm for one attribute from its index in the main attributes vector.
This method returns a boolean set to true if the attribute with the given index in the attrobite object vector is in alarm condition
ind | The attribute index |
DevFailed | If the attribute does not have any alarm level defined. Click here to read DevFailed exception specification |
References Tango::Attribute::check_alarm(), and get_attr_by_ind().
|
inline |
Get list of attribute with an alarm level defined.
References alarm_attr_list.
|
inline |
Get Attribute object from its index.
This method returns a reference to the Attribute object from the index in the main attribute vector
ind | The attribute index |
References attr_list.
Referenced by check_alarm().
Attribute& Tango::MultiAttribute::get_attr_by_name | ( | const char * | attr_name | ) |
Get Attribute object from its name.
This method returns a reference to the Attribute object with a name passed as parameter. The equality on attribute name is case independant.
attr_name | The attribute name |
DevFailed | If the attribute is not defined. Click here to read DevFailed exception specification |
Referenced by check_alarm().
long Tango::MultiAttribute::get_attr_ind_by_name | ( | const char * | attr_name | ) |
Get Attribute index into the main attribute vector from its name.
This method returns the index in the Attribute vector (stored in the MultiAttribute object) of an attribute with a given name. The name equality is case independant
attr_name | The attribute name |
DevFailed | If the attribute is not found in the vector. Click here to read DevFailed exception specification |
|
inline |
|
inline |
|
inline |
Get Writable Attribute object from its index.
This method returns a reference to the Writable Attribute object from the index in the main attribute vector
ind | The attribute index |
References attr_list.
WAttribute& Tango::MultiAttribute::get_w_attr_by_name | ( | const char * | attr_name | ) |
Get Writable Attribute object from its name.
This method returns a reference to the WAttribute object with a name passed as parameter. The equality on attribute name is case independant.
attr_name | The attribute name |
DevFailed | If the attribute is not defined. Click here to read DevFailed exception specification |
void Tango::MultiAttribute::read_alarm | ( | string & | status | ) |
Add alarm message to device status.
This method add alarm mesage to the string passed as parameter. A message is added for each attribute which is in alarm condition
status | The string (should be the device status) |
|
protected |
The list of attribute with an alarm level defined.
It is a vector of index in the main attribute vector
Referenced by get_alarm_list().
|
protected |
The Attribute objects vector.
This vector is often referred as the main attributes vector
Referenced by get_attr_by_ind(), get_attr_nb(), get_attribute_list(), and get_w_attr_by_ind().
|
protected |
The list of writable attribute.
It is a vector of index in the main attribute vector