Tango Core Classes Reference  9.3.3
Tango::MultiAttribute Class Reference

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
Attributeget_attr_by_name (const char *attr_name)
 Get Attribute object from its name. More...
 
Attributeget_attr_by_ind (const long ind)
 Get Attribute object from its index. More...
 
WAttributeget_w_attr_by_name (const char *attr_name)
 Get Writable Attribute object from its name. More...
 
WAttributeget_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...
 

Detailed Description

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$

Constructor & Destructor Documentation

◆ MultiAttribute()

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.

Parameters
dev_nameThe device name
dev_classReference to the device DeviceClass object
devThe device pointer
Exceptions
DevFailedIf the command sent to the database failed. Click here to read DevFailed exception specification

Member Function Documentation

◆ check_alarm() [1/3]

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.

Returns
A boolean set to true if one attribute is in alarm
Exceptions
DevFailedIf the alarm level are not defined for one of the attribute in the list of alarmable one Click here to read DevFailed exception specification

◆ check_alarm() [2/3]

bool Tango::MultiAttribute::check_alarm ( const char *  attr_name)
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

Parameters
attr_nameThe attribute name
Returns
A boolean set to true if the attribute is in alarm
Exceptions
DevFailedIf 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().

◆ check_alarm() [3/3]

bool Tango::MultiAttribute::check_alarm ( const long  ind)
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

Parameters
indThe attribute index
Returns
A boolean set to true if the attribute is in alarm
Exceptions
DevFailedIf 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().

◆ get_alarm_list()

vector<long>& Tango::MultiAttribute::get_alarm_list ( )
inline

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

References alarm_attr_list.

◆ get_attr_by_ind()

Attribute& Tango::MultiAttribute::get_attr_by_ind ( const long  ind)
inline

Get Attribute object from its index.

This method returns a reference to the Attribute object from the index in the main attribute vector

Parameters
indThe attribute index
Returns
A reference to the Attribute object

References attr_list.

Referenced by check_alarm().

◆ get_attr_by_name()

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.

Parameters
attr_nameThe attribute name
Returns
A reference to the Attribute object
Exceptions
DevFailedIf the attribute is not defined. Click here to read DevFailed exception specification

Referenced by check_alarm().

◆ get_attr_ind_by_name()

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

Parameters
attr_nameThe attribute name
Returns
The index in the main attributes vector
Exceptions
DevFailedIf the attribute is not found in the vector. Click here to read DevFailed exception specification

◆ get_attr_nb()

unsigned long Tango::MultiAttribute::get_attr_nb ( )
inline

Get attribute number.

Returns
The attribute number

References attr_list.

◆ get_attribute_list()

vector<Attribute *>& Tango::MultiAttribute::get_attribute_list ( )
inline

Get the vector of attribute objects.

Returns the vector of attribute objects.

References attr_list.

◆ get_w_attr_by_ind()

WAttribute& Tango::MultiAttribute::get_w_attr_by_ind ( const long  ind)
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

Parameters
indThe attribute index
Returns
A reference to the WAttribute object

References attr_list.

◆ get_w_attr_by_name()

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.

Parameters
attr_nameThe attribute name
Returns
A reference to the writable attribute object
Exceptions
DevFailedIf the attribute is not defined. Click here to read DevFailed exception specification

◆ read_alarm()

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

Parameters
statusThe string (should be the device status)

Member Data Documentation

◆ alarm_attr_list

vector<long> Tango::MultiAttribute::alarm_attr_list
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().

◆ attr_list

vector<Attribute *> Tango::MultiAttribute::attr_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().

◆ writable_attr_list

vector<long> Tango::MultiAttribute::writable_attr_list
protected

The list of writable attribute.

It is a vector of index in the main attribute vector


The documentation for this class was generated from the following file: