class MultiAttribute

There is one instance of this class for each device

Public

Constructor
MultiAttribute(string &dev_name, DeviceClass *dev_class)
Create a new MultiAttribute object
Destructor
~MultiAttribute()
The MultiAttribute desctructor
Miscellaneous methods
Attribute& get_attr_by_name(const char *attr_name)
Get Attribute object from its name
Attribute& get_attr_by_ind(const long ind)
Get Attribute object from its index
WAttribute& get_w_attr_by_name(const char *attr_name)
Get Writable Attribute object from its name
WAttribute& get_w_attr_by_ind(const long ind)
Get Writable Attribute object from its index
long get_attr_ind_by_name(const char *attr_name)
Get Attribute index into the main attribute vector from its name
vector & get_alarm_list()
Get list of attribute with an alarm level defined
long get_attr_nb()
Get attribute number
bool check_alarm(const char *attr_name)
Check alarm for one attribute with a given name
bool check_alarm(const long ind)
Check alarm for one attribute from its index in the main attributes vector
bool check_alarm()
Check alarm on all attribute(s) with an alarm defined
void read_alarm(string &status)
Add alarm message to device status

Protected

Class data members
vector <Attribute *> attr_list
The Attribute objects vector
vector writable_attr_list
The list of writable attribute
vector alarm_attr_list
The list of attribute with an alarm level defined

Documentation

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
Constructor
Only one constructor is defined for this class

MultiAttribute(string &dev_name, DeviceClass *dev_class)
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.
Throws:
DevFailed If the command sent to the database failed. Click here to read DevFailed exception specification
Parameters:
dev_name - The device name
dev_class - Reference to the device DeviceClass object

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. This method returns a reference to the Attribute object with a name passed as parameter. The equality on attribute name is case independant.
Throws:
DevFailed If the attribute is not defined. Click here to read DevFailed exception specification
Returns:
A reference to the Attribute object
Parameters:
attr_name - The attribute name

Attribute& get_attr_by_ind(const long ind)
Get Attribute object from its index. This method returns a reference to the Attribute object from the index in the main attribute vector
Returns:
A reference to the Attribute object
Parameters:
ind - The attribute index

WAttribute& 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.
Throws:
DevFailed If the attribute is not defined. Click here to read DevFailed exception specification
Returns:
A reference to the writable attribute object
Parameters:
attr_name - The attribute name

WAttribute& get_w_attr_by_ind(const long ind)
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
Returns:
A reference to the WAttribute object
Parameters:
ind - The attribute index

long 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
Throws:
DevFailed If the attribute is not found in the vector. Click here to read DevFailed exception specification
Parameters:
attr_name - The attribute name @retrun The index in the main attributes vector

vector & get_alarm_list()
Get list of attribute with an alarm level defined.
Returns:
A vector of long data. Each object is the index in the main attribute vector of attribute with alarm level defined

long get_attr_nb()
Get attribute number.
Returns:
The attribute number

bool check_alarm(const char *attr_name)
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
Throws:
DevFailed If the attribute does not have any alarm level defined. Click here to read DevFailed exception specification
Returns:
A boolean set to true if the attribute is in alarm
Parameters:
attr_name - The attribute name

bool check_alarm(const long ind)
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
Throws:
DevFailed If the attribute does not have any alarm level defined. Click here to read DevFailed exception specification
Returns:
A boolean set to true if the attribute is in alarm
Parameters:
ind - The attribute index

bool 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.
Throws:
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
Returns:
A boolean set to true if one attribute is in alarm

void 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
Parameters:
status - The string (should be the device status)

Class data members

vector <Attribute *> attr_list
The Attribute objects vector. This vector is often referred as the main attributes vector

vector writable_attr_list
The list of writable attribute. It is a vector of index in the main attribute vector

vector alarm_attr_list
The list of attribute with an alarm level defined. It is a vector of index in the main attribute vector


This class has no child classes.
Author:
$Author: taurel $
Version:
$Revision: 1.3 $

alphabetic index hierarchy of classes


generated by doc++