Tango Core Classes Reference
9.3.4
|
Base class for all TANGO device-class class. More...
#include "tango.h"
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. More... | |
virtual void | command_factory ()=0 |
Create command objects for all command supported by this class of device. More... | |
virtual void | attribute_factory (vector< Attr * > &) |
Create all the attributes name supported by this class of device. More... | |
virtual void | pipe_factory () |
Create all the pipes supported by this class of device. More... | |
virtual void | device_factory (const Tango::DevVarStringArray *dev_list)=0 |
Create device(s). More... | |
virtual void | device_name_factory (vector< string > &list) |
Create device(s) name list (for no database device server). More... | |
void | device_destroyer (const string &dev_name) |
Delete device. More... | |
void | device_destroyer (const char *dev_name) |
Delete device. More... | |
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. More... | |
string & | get_doc_url () |
Get the TANGO device class documentation URL. More... | |
string & | get_type () |
Get the TANGO device type name. More... | |
vector< DeviceImpl * > & | get_device_list () |
Get the device object vector. More... | |
vector< Command * > & | get_command_list () |
Get the command object vector. More... | |
vector< Pipe * > & | get_pipe_list (const string &dev_name) |
Get the pipe object vector. More... | |
Command & | get_cmd_by_name (const string &) |
Get a reference to a command object. More... | |
Pipe & | get_pipe_by_name (const string &pipe_name, const string &dev_name) |
Get a reference to a pipe object. More... | |
DbClass * | get_db_class () |
Get a pointer to the associated DbClass object. More... | |
MultiClassAttribute * | get_class_attr () |
Get a pointer to the class attributes object. More... | |
MultiClassPipe * | get_class_pipe () |
Get a pointer to the class pipes object. More... | |
void | set_type (string &dev_type) |
Set the TANGO device type name. More... | |
void | set_type (const char *dev_type) |
Set the TANGO device type name. More... | |
Signal related methods | |
These methods allow a signal management at device level | |
void | register_signal (long signo, bool own_handler=false) |
Register a signal. More... | |
void | unregister_signal (long signo) |
Unregister a signal. More... | |
virtual void | signal_handler (long signo) |
Signal handler. More... | |
Protected Member Functions | |
Constructor | |
Only one constructot for this class which is a singleton | |
DeviceClass (string &s) | |
Construct a newly allocated DeviceClass object. More... | |
Miscellaneous protected methods | |
void | export_device (DeviceImpl *dev, const char *corba_dev_name="Unused") |
Export a device. More... | |
void | set_default_command (Command *cmd) |
Set a Tango classs default command. More... | |
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. | |
MultiClassPipe * | class_pipe |
Pointer to the class multi pipe object. | |
vector< Pipe * > | pipe_list |
The pipe(s) list. | |
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$ $Revision$
|
protected |
Construct a newly allocated DeviceClass object.
s | The Tango device class name |
|
inlinevirtual |
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 create and store the supported attributes in a vector.
|
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.
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 |
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
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
dev_name | Reference to the device name |
|
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
dev_list | The device name list |
DevFailed | This method does not throw exception but a redefined method can. Click here to read DevFailed exception specification |
|
inlinevirtual |
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.
list | Reference to the device name list |
|
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.
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. |
DevFailed | If the command sent to the database failed. Click here to read DevFailed exception specification |
|
inline |
Get a pointer to the class attributes object.
|
inline |
Get a pointer to the class pipes object.
Command& Tango::DeviceClass::get_cmd_by_name | ( | const string & | ) |
Get a reference to a command object.
|
inline |
Get the command object vector.
|
inline |
Get a pointer to the associated DbClass object.
|
inline |
Get the device object vector.
|
inline |
Get the TANGO device class documentation URL.
|
inline |
Get the TANGO device class name.
Pipe& Tango::DeviceClass::get_pipe_by_name | ( | const string & | pipe_name, |
const string & | dev_name | ||
) |
Get a reference to a pipe object.
pipe_name | The pipe name |
dev_name | The device name |
vector<Pipe *>& Tango::DeviceClass::get_pipe_list | ( | const string & | dev_name | ) |
Get the pipe object vector.
dev_name | The device name |
|
inline |
Get the TANGO device type name.
|
inlinevirtual |
Create all the pipes 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 pipes. Its rule is to create and store the supported pipes in a vector.
void Tango::DeviceClass::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.
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 * |
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 |
|
inlineprotected |
|
inline |
Set the TANGO device type name.
dev_type | The new TANGO device type name |
|
inline |
Set the TANGO device type name.
dev_type | The new TANGO device type name |
|
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.
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
signo | The signal number |
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 |