ESRF Logo

Elettra Logo

Soleil Logo

Alba Logo

Desy Logo

MAX-lab Logo

FRM2 Logo


SYNCHROTRON ALBA --- SYNCHROTRON ELETTRA

EUROPEAN SYNCHROTRON RADIATION FACILITY --- SYNCHROTRON PETRA III

SYNCHROTRON SOLEIL --- SYNCHROTRON MAX 4

NEUTRON SOURCE FRM 2

Tango::MultiAttribute Class Reference

There is one instance of this class for each device. More...

#include <multiattribute.h>

List of all members.

Public Member Functions

Constructor
Only one constructor is defined for this class

 MultiAttribute (string &dev_name, DeviceClass *dev_class)
 Create a new MultiAttribute object.
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.
Attributeget_attr_by_ind (const long ind)
 Get Attribute object from its index.
WAttributeget_w_attr_by_name (const char *attr_name)
 Get Writable Attribute object from its name.
WAttributeget_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< long > & get_alarm_list ()
 Get list of attribute with an alarm level defined.
unsigned 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.
vector< Attribute * > & get_attribute_list ()
 Get the vetctor of attribute objects.

Protected Attributes

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


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
taurel
Revision
15556

Constructor & Destructor Documentation

Tango::MultiAttribute::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.

Parameters:
dev_name The device name
dev_class Reference to the device DeviceClass object
Exceptions:
DevFailed If the command sent to the database failed. Click here to read DevFailed exception specification


Member Function Documentation

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:
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

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

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_name The attribute name
Returns:
A boolean set to true if the attribute is in alarm
Exceptions:
DevFailed If the attribute does not have any alarm level defined. Click here to read DevFailed exception specification

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

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:
ind The attribute index
Returns:
A reference to the Attribute object

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_name The attribute name
Returns:
A reference to the Attribute object
Exceptions:
DevFailed If the attribute is not defined. Click here to read DevFailed exception specification

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_name The attribute name
Returns:
The index in the main attributes vector
Exceptions:
DevFailed If the attribute is not found in the vector. Click here to read DevFailed exception specification

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

Get attribute number.

Returns:
The attribute number

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

Get the vetctor of attribute objects.

Returns the vector of attribute objects.

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:
ind The attribute index
Returns:
A reference to the WAttribute object

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_name The attribute name
Returns:
A reference to the writable attribute object
Exceptions:
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

Parameters:
status The string (should be the device status)


Member Data Documentation

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

The Attribute objects vector.

This vector is often referred as the main attributes vector

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:
Tango Device Server User's Guide



ALBA - Control Team / DESY - Hasylab Petra III

ELETTRA - Controls and Diagnostics / ESRF - Software Engineering Group

SOLEIL - Controle Commande et Acquisition / MAX-lab - MAX 4

FRM2 - Control group