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::DeviceClass Class Reference

Base class for all TANGO device-class class. More...

#include <deviceclass.h>

List of all members.

Public Member Functions

Destructor
Only one desctructor is defined for this class

virtual ~DeviceClass ()
 The device destructor.
Miscellaneous methods
CORBA::Any * command_handler (DeviceImpl *device, string &command, const CORBA::Any &in_any)
 Execute a command.
virtual void command_factory ()=0
 Create command objects for all command supported by this class of device.
virtual void attribute_factory (vector< Attr * > &)
 Create all the attributes name supported by this class of device.
virtual void device_factory (const Tango::DevVarStringArray *dev_list)=0
 Create device(s).
virtual void device_name_factory (vector< string > &)
 Create device(s) name list (for no database device server).
void device_destroyer (const string &dev_name)
 Delete device.
void device_destroyer (const char *dev_name)
 Delete device.
Get/Set object members.
These methods allows the external world to get/set DeviceImpl instance data members

string & get_name ()
 Get the TANGO device class name.
string & get_doc_url ()
 Get the TANGO device class documentation URL.
string & get_type ()
 Get the TANGO device type name.
vector< DeviceImpl * > & get_device_list ()
 Get the device object vector.
vector< Command * > & get_command_list ()
 Get the command object vector.
DbClass * get_db_class ()
 Get a pointer to the associated DbClass object.
MultiClassAttribute * get_class_attr ()
 Get a pointer to the class attributes object.
void set_type (string &dev_type)
 Set the TANGO device type name.
void set_type (const char *dev_type)
 Set the TANGO device type name.
Signal related methods
These methods allow a signal management at device level

void register_signal (long signo)
 Register a signal.
void unregister_signal (long signo)
 Unregister a signal.
virtual void signal_handler (long signo)
 Signal handler.

Protected Member Functions

Constructor
Only one constructot for this class which is a singleton

 DeviceClass (string &s)
 Construct a newly allocated DeviceClass object.
Miscellaneous protected methods
void export_device (DeviceImpl *dev, const char *corba_dev_name="Unused")
 Export a device.
void set_default_command (Command *cmd)
 Set a Tango classs default command.

Protected Attributes

Class data members
string name
 The TANGO device class name.
string doc_url
 The TANGO device class documentation URL.
string type
 The TANGO device type name.
vector< Command * > command_list
 The command(s) list.
vector< DeviceImpl * > device_list
 The device(s) list.
DbClass * db_class
 The associated DbClass object.
MultiClassAttribute * class_attr
 Pointer to the class multi attribute object.


Detailed Description

Base class for all TANGO device-class class.

A TANGO device-class class is a class where is stored all data/method common to all devices of a TANGO device class

Author
taurel
Revision
15556

Constructor & Destructor Documentation

Tango::DeviceClass::DeviceClass ( string &  s  )  [protected]

Construct a newly allocated DeviceClass object.

Parameters:
s The Tango device class name


Member Function Documentation

virtual void Tango::DeviceClass::attribute_factory ( vector< Attr * > &   )  [inline, virtual]

Create all the attributes name supported by this class of device.

In the DeviceClass class, this method does nothing and must be re-defined in sub-class if the sub-class supports attributes. Its rule is to store the supported attributes in a vector.

virtual void Tango::DeviceClass::command_factory (  )  [pure virtual]

Create command objects for all command supported by this class of device.

In the DeviceClass class, this method is pure abstract and must be defined in sub-class. Its rule is to create the command object and to store them in a vector of command objects

CORBA::Any* Tango::DeviceClass::command_handler ( DeviceImpl device,
string &  command,
const CORBA::Any &  in_any 
)

Execute a command.

It looks for the correct command object in the command object vector. If the command is found, it invoke the always_executed_hook method. Check if the command is allowed by invoking the is_allowed method If the command is allowed, invokes the execute method.

Parameters:
device The device on which the command must be executed
command The command name
in_any The command input data still packed in a CORBA Any object
Returns:
A CORBA Any object with the output data packed in
Exceptions:
DevFailed If the command is not found, if the command is not allowed in the actual device state and re-throws of all the exception thrown by the always_executed_hook, is_alloed and execute methods. Click here to read DevFailed exception specification

void Tango::DeviceClass::device_destroyer ( const char *  dev_name  ) 

Delete device.

The rule of this method is to delete a device from the running device belonging to the Tango class. It does change anything in the database

Parameters:
dev_name Reference to the device name

void Tango::DeviceClass::device_destroyer ( const string &  dev_name  ) 

Delete device.

The rule of this method is to delete a device from the running server belonging to the Tango class. It does change anything in the database

Parameters:
dev_name Reference to the device name

virtual void Tango::DeviceClass::device_factory ( const Tango::DevVarStringArray *  dev_list  )  [pure virtual]

Create device(s).

In the DeviceClass class, this method is pure abstract and must be defined in sub-class. Its rule is to create all the class devices and to store them in a vector of device

Parameters:
dev_list The device name list
Exceptions:
DevFailed This method does not throw exception but a redefined method can. Click here to read DevFailed exception specification

virtual void Tango::DeviceClass::device_name_factory ( vector< string > &   )  [inline, virtual]

Create device(s) name list (for no database device server).

This method can be re-defined in DeviceClass sub-class for device server started without database. Its rule is to initialise class device name. The default method does nothing.

Parameters:
list Reference to the device name list

void Tango::DeviceClass::export_device ( DeviceImpl dev,
const char *  corba_dev_name = "Unused" 
) [protected]

Export a device.

Associate the servant to a CORBA object and send device network parameter to TANGO database. The main parameter sent to database is the CORBA object stringified device IOR.

Parameters:
dev The device to be exported (CORBA servant)
corba_dev_name The name to be used in the CORBA object key. This parameter does not need to be set in most of cases and has a default value. It is used for special device server like the database device server.
Exceptions:
DevFailed If the command sent to the database failed. Click here to read DevFailed exception specification

MultiClassAttribute* Tango::DeviceClass::get_class_attr (  )  [inline]

Get a pointer to the class attributes object.

Returns:
A pointer to the instance of the MultiClassAttribute

vector<Command *>& Tango::DeviceClass::get_command_list (  )  [inline]

Get the command object vector.

Returns:
A reference to the command vector

DbClass* Tango::DeviceClass::get_db_class (  )  [inline]

Get a pointer to the associated DbClass object.

Returns:
Pointer to the DbClas object

vector<DeviceImpl *>& Tango::DeviceClass::get_device_list (  )  [inline]

Get the device object vector.

Returns:
A reference to the device vector

string& Tango::DeviceClass::get_doc_url (  )  [inline]

Get the TANGO device class documentation URL.

Returns:
The TANGO device class documentation

string& Tango::DeviceClass::get_name (  )  [inline]

Get the TANGO device class name.

Returns:
The TANGO device class name

string& Tango::DeviceClass::get_type (  )  [inline]

Get the TANGO device type name.

Returns:
The TANGO device type name

void Tango::DeviceClass::register_signal ( long  signo  ) 

Register a signal.

Register this class as class to be informed when signal signo is sent to to the device server process

Parameters:
signo The signal number
Exceptions:
DevFailed Thrown if the signal number is out of range or if the operating system failed to register a signal for the process. Click here to read DevFailed exception specification

void Tango::DeviceClass::set_default_command ( Command cmd  )  [inline, protected]

Set a Tango classs default command.

Define one command to be the Tango class default command The default command is the command which will be exceuted when an unknown command is sent to one of the Tango class device By default, there is no default class

Parameters:
cmd The command object

void Tango::DeviceClass::set_type ( const char *  dev_type  )  [inline]

Set the TANGO device type name.

Parameters:
dev_type The new TANGO device type name

void Tango::DeviceClass::set_type ( string &  dev_type  )  [inline]

Set the TANGO device type name.

Parameters:
dev_type The new TANGO device type name

virtual void Tango::DeviceClass::signal_handler ( long  signo  )  [virtual]

Signal handler.

The method executed when the signal arrived in the device server process. This method is defined as virtual and then, can be redefined following device class needs.

Parameters:
signo The signal number

void Tango::DeviceClass::unregister_signal ( long  signo  ) 

Unregister a signal.

Unregister this class as class to be informed when signal signo is sent to to the device server process

Parameters:
signo The signal number
Exceptions:
DevFailed Thrown if the signal number is out of range or if the operating system failed to unregister a signal for the process. Unregister a device for a signal number for a device not previously registered is not an error. This simply will do nothing. Click here to read DevFailed exception specification


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