class DeviceClass : public JTCMonitor

Base class for all TANGO device-class class

Inheritance:


Public

Destructor
virtual ~DeviceClass()
The device desctructor
Miscellaneous methods
CORBA::Any* command_handler(DeviceImpl *device, string &command, const CORBA::Any &in_any)
Execute a command
virtual void command_factory()
Create command objects for all command supported by this class of device
virtual void attribute_factory(vector<Attr *> &att_list)
Create all the attributes name supported by this class of device
virtual void device_factory(const Tango::DevVarStringArray *)
Create device(s)
Get/Set object members.
string& get_name()
Get the TANGO device class name
string& get_doc_url()
Get the TANGO device class documentation URL
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
Signal related methods
void register_signal(long signo)
Register a signal
void register_signal(long signo, bool own_handler = false)
Register a signal
void unregister_signal(long signo)
Unregister a signal
virtual void signal_handler(long signo)
Signal handler

Protected

Constructor
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
Class data members
string name
The TANGO device class name
string doc_url
The TANGO device class documentation URL
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

Documentation

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
Destructor
Only one desctructor is defined for this class

virtual ~DeviceClass()
The device desctructor

Miscellaneous methods

CORBA::Any* 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.
Throws:
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
Returns:
A CORBA Any object with the output data packed in
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

virtual void command_factory()
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

virtual void attribute_factory(vector<Attr *> &att_list)
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 device_factory(const Tango::DevVarStringArray *)
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 calss devices and to store them in a vector of device
Throws:
DevFailed This method does not throw exception but a redefined method can. Click here to read DevFailed exception specification
Parameters:
dev_list - The device name list

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.
Returns:
The TANGO device class name

string& get_doc_url()
Get the TANGO device class documentation URL.
Returns:
The TANGO device class documentation

vector <DeviceImpl *> & get_device_list()
Get the device object vector.
Returns:
A reference to the device vector

vector <Command *> & get_command_list()
Get the command object vector.
Returns:
A reference to the command vector

DbClass* get_db_class()
Get a pointer to the associated DbClass object.
Returns:
Pointer to the DbClas object

MultiClassAttribute* get_class_attr()
Get a pointer to the class attributes object
Returns:
A pointer to the instance of the MultiClassAttribute

Signal related methods
These methods allow a signal management at device level

void 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
Throws:
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
Parameters:
signo - The signal number

void register_signal(long signo, bool own_handler = false)
Register a signal. Register this class as class to be informed when signal signo is sent to to the device server process. This method is available only under Linux.
Parameters:
signo - The signal number
own_handler - A boolean set to true if you want the device signal handler to be executed in its own handler instead of being executed by the signal thread. If this parameter is set to true, care should be taken on how the handler is written. A default false value is provided * @exception 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 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
Throws:
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
Parameters:
signo - The signal number

virtual void signal_handler(long signo)
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

Constructor
Only one constructot for this class which is a singleton

DeviceClass(string &s)
Construct a newly allocated DeviceClass object.
Parameters:
s - The Tango device class name

Miscellaneous protected methods

void export_device(DeviceImpl *dev, const char* corba_dev_name = "Unused")
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.
Throws:
DevFailed If the command sent to the database failed. Click here to read DevFailed exception specification
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.

Class data members

string name
The TANGO device class name

string doc_url
The TANGO device class documentation URL

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


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

alphabetic index hierarchy of classes


generated by doc++