Tango Core Classes Reference  9.3.3
Tango::Database Class Reference

A high level object which contains the link to the database. More...

#include "tango.h"

Inheritance diagram for Tango::Database:
Collaboration diagram for Tango::Database:

Public Member Functions

Constructors
 Database (CORBA::ORB *orb=NULL)
 Create a TANGO Database object. More...
 
General methods
string get_info ()
 Get database info. More...
 
Device oriented methods
void add_device (DbDevInfo &dev_info)
 Add a device into the database. More...
 
void delete_device (string dev_name)
 Delete a device from the database. More...
 
DbDevImportInfo import_device (string &dev_name)
 Import a device from the database. More...
 
void export_device (DbDevExportInfo &info)
 Export a device into the database. More...
 
void unexport_device (string dev_name)
 Unexport a device in the database. More...
 
DbDevFullInfo get_device_info (string &dev_name)
 Get device information. More...
 
string get_class_for_device (string &dev_name)
 Get class name for a device. More...
 
DbDatum get_class_inheritance_for_device (string &dev_name)
 Get device inheritance scheme. More...
 
Server oriented methods
void add_server (string &ds_name, DbDevInfos &devs)
 Create a device server process in database. More...
 
void delete_server (string &ds_name)
 Delete a device server process from the database. More...
 
void export_server (DbDevExportInfos &devs)
 Delete a device server process from the database. More...
 
void unexport_server (string &ds_name)
 Unexport all devices from a device server in the database. More...
 
void rename_server (const string &old_ds_name, const string &new_ds_name)
 Rename a device server in the database. More...
 
Services oriented methods
DbDatum get_services (string &service_name, string &inst_name)
 Get services list from database. More...
 
DbDatum get_device_service_list (string &service_name)
 Get services list from database. More...
 
void register_service (string &service_name, string &inst_name, string &dev_name)
 Register a service in the database. More...
 
void unregister_service (string &service_name, string &inst_name)
 Unregister a service from the database. More...
 
Object property oriented methods
void get_property (string obj_name, DbData &db)
 Get object property value. More...
 
void put_property (string obj_name, DbData &db)
 Put object property value in database. More...
 
void delete_property (string obj_name, DbData &db)
 Delete object property from database. More...
 
vector< DbHistoryget_property_history (string &obj_name, string &prop_name)
 Get object property history from database. More...
 
Device property oriented methods
void get_device_property (string dev_name, DbData &db)
 Get device property value. More...
 
void put_device_property (string dev_name, DbData &db)
 Put device property value in database. More...
 
void delete_device_property (string dev_name, DbData &db)
 Delete device property from database. More...
 
vector< DbHistoryget_device_property_history (string &dev_name, string &prop_name)
 Get device property history from database. More...
 
Device attribute property oriented methods
void get_device_attribute_property (string dev_name, DbData &db)
 Get device attribute property value. More...
 
void put_device_attribute_property (string dev_name, DbData &db)
 Put device attribute property value in database. More...
 
void delete_device_attribute_property (string dev_name, DbData &db)
 Delete device attribute property from database. More...
 
vector< DbHistoryget_device_attribute_property_history (string &dev_name, string &prop_name, string &att_name)
 Get device attribute property history from database. More...
 
void get_device_attribute_list (string &dev_name, vector< string > &att_list)
 Get list of attribute with data in database for a specific device. More...
 
void get_device_pipe_list (const string &dev_name, vector< string > &pipe_list)
 Get list of pipe with data in database for a specific device. More...
 
Device pipe property oriented methods
void get_device_pipe_property (string dev_name, DbData &db)
 Get device pipe property value. More...
 
void put_device_pipe_property (string dev_name, DbData &db)
 Put device pipe property value in database. More...
 
void delete_device_pipe_property (string dev_name, DbData &db)
 Delete device pipe property from database. More...
 
vector< DbHistoryget_device_pipe_property_history (string &dev_name, string &pipe_name, string &prop_name)
 Get device pipe property history from database. More...
 
Class property oriented methods
void get_class_property (string class_name, DbData &db)
 Get class property value. More...
 
void put_class_property (string class_name, DbData &db)
 Put class property value in database. More...
 
void delete_class_property (string class_name, DbData &db)
 Delete class property from database. More...
 
vector< DbHistoryget_class_property_history (string &class_name, string &prop_name)
 Get class property history from database. More...
 
Class attribute property oriented methods
void get_class_attribute_property (string class_name, DbData &db)
 Get class attribute property value. More...
 
void put_class_attribute_property (string class_name, DbData &db)
 Put class attribute property value in database. More...
 
void delete_class_attribute_property (string class_name, DbData &db)
 Delete class attribute property from database. More...
 
vector< DbHistoryget_class_attribute_property_history (string &class_name, string &att_name, string &prop_name)
 Get class attribute property history from database. More...
 
Class pipe property oriented methods
void get_class_pipe_property (string class_name, DbData &db)
 Get class pipe property value. More...
 
void put_class_pipe_property (string class_name, DbData &db)
 Put class pipe property value in database. More...
 
void delete_class_pipe_property (string class_name, DbData &db)
 Delete class pipe property from database. More...
 
vector< DbHistoryget_class_pipe_property_history (string &class_name, string &pipe_name, string &prop_name)
 Get class pipe property history from database. More...
 
Alias oriented methods
void get_device_from_alias (string alias, string &dev_name)
 Get device name from its alias. More...
 
void get_alias_from_device (string dev_name, string &alias)
 Get device alias form its name. More...
 
void get_alias (string dev_name, string &dev_alias)
 Get device alias from its name. More...
 
void get_device_alias (string dev_alias, string &dev_name)
 Get device name from its alias. More...
 
void put_device_alias (string &dev_name, string &dev_alias)
 Define device alias. More...
 
void delete_device_alias (string &dev_alias)
 Delete device alias. More...
 
void get_attribute_from_alias (string alias, string &att_name)
 Get attribute name from its alias. More...
 
void get_alias_from_attribute (string att_name, string &alias)
 Get attribute alias form its name. More...
 
void get_attribute_alias (string att_alias, string &att_name)
 Get attribute name from its alias. More...
 
void put_attribute_alias (string &att_name, string &att_alias)
 Define attribute alias. More...
 
void delete_attribute_alias (string &att_alias)
 Delete attribute alias. More...
 
Database browsing oriented methods
DbDatum get_host_list ()
 Get host list. More...
 
DbDatum get_host_list (string &wildcard)
 Get host list with name matching a wildcard. More...
 
DbDatum get_server_class_list (string &ds_name)
 Get list of Tango classes embedded in a device server proess. More...
 
DbDatum get_server_name_list ()
 Get list of all Tango device server process. More...
 
DbDatum get_instance_name_list (string &ds_name)
 Get list of instances. More...
 
DbDatum get_server_list ()
 Get list of device server processes. More...
 
DbDatum get_server_list (string &wildcard)
 Get list of device server processes with a wildcard. More...
 
DbDatum get_host_server_list (string &host_name)
 Get list of device server processes running on a host. More...
 
DbDatum get_device_name (string &ds_name, string &class_name)
 Get list of devices served by a device server process. More...
 
DbDatum get_device_exported (string &filter)
 Get list of exported devices. More...
 
DbDatum get_device_domain (string &wildcard)
 Get list of device domain names. More...
 
DbDatum get_device_family (string &wildcard)
 Get list of device family name. More...
 
DbDatum get_device_member (string &wildcard)
 Get list of device member name. More...
 
DbDatum get_device_class_list (string &ds_name)
 Get list of devices/classes for a specified device server. More...
 
DbDatum get_device_exported_for_class (string &class_name)
 Get list of exported device for a class. More...
 
DbDatum get_object_list (string &wildcard)
 Get object (free property) list. More...
 
DbDatum get_object_property_list (string &obj_name, string &wildcard)
 Get object property list. More...
 
DbDatum get_class_list (string &wildcard)
 Get Tango class list. More...
 
DbDatum get_class_property_list (string &class_name)
 Get class property list. More...
 
DbDatum get_class_attribute_list (string &class_name, string &wildcard)
 Get class attribute list. More...
 
DbDatum get_class_pipe_list (const string &class_name, const string &wildcard)
 Get class pipe list. More...
 
DbDatum get_device_alias_list (string &filter)
 Get device alias list. More...
 
DbDatum get_attribute_alias_list (string &filter)
 Get attribute alias list. More...
 
- Public Member Functions inherited from Tango::Connection
virtual void set_timeout_millis (int timeout)
 Set device timeout. More...
 
virtual int get_timeout_millis ()
 Get device timeout. More...
 
int get_idl_version ()
 Get device IDL version. More...
 
virtual Tango::DevSource get_source ()
 Get device source. More...
 
virtual void set_source (Tango::DevSource sou)
 Set device source. More...
 
virtual void set_transparency_reconnection (bool val)
 Set device transparency (reconnection) mode. More...
 
virtual bool get_transparency_reconnection ()
 Get device transparency (reconnection) mode. More...
 
virtual DeviceData command_inout (string &cmd_name)
 Execute a command (without input data) More...
 
virtual DeviceData command_inout (const char *cmd_name)
 Execute a command (without input data) More...
 
virtual DeviceData command_inout (string &cmd_name, DeviceData &d_in)
 Execute a command (with input data) More...
 
virtual DeviceData command_inout (const char *cmd_name, DeviceData &d_in)
 Execute a command (with input data) More...
 
virtual long command_inout_asynch (const char *cmd_name, DeviceData &argin, bool forget=false)
 Execute a command asynchronously (with input argument) More...
 
virtual long command_inout_asynch (string &cmd_name, DeviceData &argin, bool forget=false)
 Execute a command asynchronously (with input argument) More...
 
virtual long command_inout_asynch (const char *cmd_name, bool forget=false)
 Execute a command asynchronously. More...
 
virtual long command_inout_asynch (string &cmd_name, bool forget=false)
 Execute a command asynchronously. More...
 
virtual DeviceData command_inout_reply (long id)
 Check an asynchronous command_inout answer is arrived. More...
 
virtual DeviceData command_inout_reply (long id, long timeout)
 Check an asynchronous command_inout answer is arrived with timeout. More...
 
virtual void command_inout_asynch (string &cmd_name, CallBack &cb)
 Execute a command asynchronously with callback. More...
 
virtual void command_inout_asynch (const char *cmd_name, CallBack &cb)
 Execute a command asynchronously with callback. More...
 
virtual void command_inout_asynch (string &cmd_name, DeviceData &argin, CallBack &cb)
 Execute a command asynchronously with input value and callback. More...
 
virtual void command_inout_asynch (const char *cmd_name, DeviceData &argin, CallBack &cb)
 Execute a command asynchronously with input value and callback. More...
 
virtual void get_asynch_replies ()
 Fire callback methods. More...
 
virtual void get_asynch_replies (long timeout)
 Fire callback methds with timeout. More...
 
virtual void cancel_asynch_request (long id)
 Cancel a pending asynchronous request. More...
 
virtual void cancel_all_polling_asynch_request ()
 Cancel all pending asynchronous request. More...
 

Detailed Description

A high level object which contains the link to the database.

This class has methods for all database commands e.g. get_device_property(), device_list(), info(), etc.

Author
taurel
Revision
1

Constructor & Destructor Documentation

◆ Database()

Tango::Database::Database ( CORBA::ORB *  orb = NULL)

Create a TANGO Database object.

The constructor uses the environment variable “TANGO_HOST” to determine which instance of the TANGO database to connect to. Example :

using namespace Tango;
Database *db = new Database();
Parameters
[in]orbThe CORBA ORB pointer. Default value is fine for 99 % of cases

Member Function Documentation

◆ add_device()

void Tango::Database::add_device ( DbDevInfo dev_info)

Add a device into the database.

Add a device to the database. The device name, server and class are specified in the DbDevInfo structure. Example :

DbDevInfo my_device_info;
my_device_info.name = “my/own/device”;
my_device_info._class = “MyDevice”;
my_device_info.server = “MyServer/test”;
db->add_device(my_device_info);
Parameters
[in]dev_infoA reference to a DbDevInfo instance with all device info.
Exceptions
ConnectionFailed,CommunnicationFailed,DevFailed

◆ add_server()

void Tango::Database::add_server ( string &  ds_name,
DbDevInfos &  devs 
)

Create a device server process in database.

Add a group of devices to the database. The device names, server names and classes are specified in a vector of DbDevInfo structures.

Parameters
[in]ds_nameThe full device server process name
[in]devsVector of DbDevInfo instances
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device (DB_SQLError)

◆ delete_attribute_alias()

void Tango::Database::delete_attribute_alias ( string &  att_alias)

Delete attribute alias.

Remove the alias associated to an attribute name.

Parameters
[in]att_aliasThe attribute alias
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ delete_class_attribute_property()

void Tango::Database::delete_class_attribute_property ( string  class_name,
DbData &  db 
)

Delete class attribute property from database.

Delete a list of attribute properties for the specified class. The attribute names are specified by the vector of DbDatum structures. All properties belonging to the listed attributes are deleted. Here is an example of how to delete the unit property of the velocity attribute of the StepperMotor class from the database using this method :

DbData db_data;
db_data.push_back(DbDatum("velocity"));
db_data.push_back(DbDatum("unit"));
db->delete_class_attribute_property("StepperMotor", db_data);
Parameters
[in]class_nameThe class name
[in]dbThe property names
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ delete_class_pipe_property()

void Tango::Database::delete_class_pipe_property ( string  class_name,
DbData &  db 
)

Delete class pipe property from database.

Delete a list of pipe properties for the specified class. The pipe names are specified by the vector of DbDatum structures. All properties belonging to the listed pipes are deleted. Here is an example of how to delete the unit property of the velocity pipe of the StepperMotor class from the database using this method :

DbData db_data;
db_data.push_back(DbDatum("velocity"));
db_data.push_back(DbDatum("unit"));
db->delete_class_pipe_property("StepperMotor", db_data);
Parameters
[in]class_nameThe class name
[in]dbThe pipe/property names
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ delete_class_property()

void Tango::Database::delete_class_property ( string  class_name,
DbData &  db 
)

Delete class property from database.

Delete a list of properties for the specified class. The property names are specified by the vector of Db- Datum structures. Here is an example of how to delete properties from the database using this method

DbData db_data;
db_data.push_back(DbDatum("velocity"));
db_data.push_back(DbDatum("acceleration"));
db->delete_class_property("StepperMotor", db_data);
Parameters
[in]class_nameThe class name
[in]dbThe property names
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ delete_device()

void Tango::Database::delete_device ( string  dev_name)

Delete a device from the database.

Delete the device of the specified name from the database. Example

db->delete_device(“my/own/device”);
Parameters
[in]dev_nameThe device name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device (DB_SQLError, DB_DeviceNotDefined)

◆ delete_device_alias()

void Tango::Database::delete_device_alias ( string &  dev_alias)

Delete device alias.

Delete a device alias.

Parameters
[in]dev_aliasThe device alias
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ delete_device_attribute_property()

void Tango::Database::delete_device_attribute_property ( string  dev_name,
DbData &  db 
)

Delete device attribute property from database.

Delete a list of attribute properties for the specified device. The attribute names are specified by the vector of DbDatum structures. Here is an example of how to delete the unit property of the velocity attribute of the id11/motor/1 device using this method :

DbData db_data;
db_data.push_back(DbDatum("velocity"));
db_data.push_back(DbDatum("unit"));
db->delete_device_attribute_property("id11/motor/1", db_data);
Parameters
[in]dev_nameThe device name
[in]dbThe property names
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ delete_device_pipe_property()

void Tango::Database::delete_device_pipe_property ( string  dev_name,
DbData &  db 
)

Delete device pipe property from database.

Delete a list of pipe properties for the specified device. The pipe names are specified by the vector of DbDatum structures. Here is an example of how to delete the unit property of the velocity pipe of the id11/motor/1 device using this method :

DbData db_data;
db_data.push_back(DbDatum("velocity"));
db_data.push_back(DbDatum("unit"));
db->delete_device_attribute_property("id11/motor/1", db_data);
Parameters
[in]dev_nameThe device name
[in]dbThe pipe/property names
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ delete_device_property()

void Tango::Database::delete_device_property ( string  dev_name,
DbData &  db 
)

Delete device property from database.

Delete a list of properties for the specified device. The property names are specified by the vector of DbDatum structures. Here is an example of how to delete properties from the database using this method :

DbData db_data;
db_data.push_back(DbDatum(“velocity”));
db_data.push_back(DbDatum(“acceleration”));
db->delete_device_property(“id11/motor/1”, db_data);
Parameters
[in]dev_nameThe device name
[in]dbThe property names
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ delete_property()

void Tango::Database::delete_property ( string  obj_name,
DbData &  db 
)

Delete object property from database.

Delete a list of properties for the specified object. The property names are specified by the vector of DbDatum structures. Here is an example of how to delete properties from the database using this method :

DbData db_data;
db_data.push_back(DbDatum(“velocity”));
db_data.push_back(DbDatum(“acceleration”));
db->delete_property(“mymotor”, db_data);
Parameters
[in]obj_nameThe object (free property) name
[in]dbThe property names
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ delete_server()

void Tango::Database::delete_server ( string &  ds_name)

Delete a device server process from the database.

Delete the device server and its associated devices from the database.

Parameters
[in]ds_nameThe full device server process name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device (DB_SQLError)

◆ export_device()

void Tango::Database::export_device ( DbDevExportInfo info)

Export a device into the database.

Update the export info for this device in the database. Device name, server, class, pid and version are specified in the DbDevExportInfo structure. Example :

DbDevExportInfo my_device_export;
my_device_export.name = “my/own/device”;
my_device_export.ior = “the real ior”;
my_device_export.host = “dumela”;
my_device_export.version = “1.0”;
my_device_export.pid = get_pid();
db->export_device(my_device_export);
Parameters
[in]infoThe device export information
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device (DB_SQLError, DB_DeviceNotDefined)

◆ export_server()

void Tango::Database::export_server ( DbDevExportInfos &  devs)

Delete a device server process from the database.

Export a group of devices to the database. The device names, IOR, class, server name, pid etc. are specified in the vector of DbDevExportInfo structures.

Parameters
[in]devsDevices information in a vector of DbDevExportInfo
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device (DB_SQLError)

◆ get_alias()

void Tango::Database::get_alias ( string  dev_name,
string &  dev_alias 
)

Get device alias from its name.

Deprecated:
use get_alias_from_device()

Get the device alias name from its name. The device name is specified by dev_name and the device alias name is returned in dev_alias. If there is no alias defined for the device, a DevFailed exception is thrown.

Parameters
[in]dev_nameThe device name
[out]dev_aliasThe device alias
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_alias_from_attribute()

void Tango::Database::get_alias_from_attribute ( string  att_name,
string &  alias 
)

Get attribute alias form its name.

Get the attribute alias from its name. The attribute name is specified by att_name and the attribute alias is returned in alias. If there is no alias defined for the attribute, a DevFailed exception is thrown.

Parameters
[in]att_nameThe attribute name
[out]aliasThe attribute alias
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_alias_from_device()

void Tango::Database::get_alias_from_device ( string  dev_name,
string &  alias 
)

Get device alias form its name.

Get the device alias from its name. The device name is specified by dev_name and the device alias is returned in alias. If there is no alias defined for the device, a DevFailed exception is thrown.

Parameters
[in]dev_nameThe device name
[out]aliasThe device alias
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_attribute_alias()

void Tango::Database::get_attribute_alias ( string  att_alias,
string &  att_name 
)

Get attribute name from its alias.

Get the full attribute name from an alias. The attribute alias is specified by att_alias and the full attribute name is returned in att_name. If there is no attribute with the given alias, a DevFailed exception is thrown.

Parameters
[in]att_aliasThe attribute alias
[out]att_nameThe attribute name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_attribute_alias_list()

DbDatum Tango::Database::get_attribute_alias_list ( string &  filter)

Get attribute alias list.

Get attribute alias list. The parameter is a string to filter the alias list returned. Wildcard (*) is supported. For instance, if the string passed as the method parameter is initialised with only the

  • character, all the defined attribute alias will be returned. The DbDatum returned by this method is initialised with an array of strings and must be extracted into a vector<string>. If there is no alias with the given filter, the returned array will have a 0 size.
Parameters
[in]filterThe filter
Returns
The attribute alias list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_attribute_from_alias()

void Tango::Database::get_attribute_from_alias ( string  alias,
string &  att_name 
)

Get attribute name from its alias.

Get the attribute name from its alias. The attribute alias is specified by alias and the attribute name is returned in att_name. If there is no attribute defined with the given alias, a DevFailed exception is thrown.

Parameters
[in]aliasThe attribute alias
[out]att_nameThe attribute name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_attribute_list()

DbDatum Tango::Database::get_class_attribute_list ( string &  class_name,
string &  wildcard 
)

Get class attribute list.

Query the database for a list of attributes defined for the specified class which match the specified wildcard.

string classname("MyClass");
string wildcard("*");
DbDatum db_datum = db->get_class_attribute_list(classname,wildcard);
vector<string> att_list;
db_datum >> att_list;
Parameters
[in]class_nameThe class name
[in]wildcardThe wildcard
Returns
The class property list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_attribute_property()

void Tango::Database::get_class_attribute_property ( string  class_name,
DbData &  db 
)
inline

Get class attribute property value.

Query the database for a list of class attribute properties for the specified object. The attribute names are specified by the vector of DbDatum structures. The method returns all the properties for the specified attributes. The attribute names are returned with the number of properties specified as their value. The first DbDatum element of the returned DbData vector contains the first attribute name and the first attribute property number. The following DbDatum element contains the first attribute property name and property values. To retrieve the properties use the extract operator >>. Here is an example of how to use the DbData type to specify and extract attribute properties :

DbData db_data;
db_data.push_back(DbDatum("velocity"));
db_data.push_back(DbDatum("acceleration"));
db->get_class_attribute_property("StepperMotor", db_data);
float vel_max, vel_min, acc_max, acc_min;
for (int i=0; i< db_data.size(); i++)
{
long nb_prop;
string &att_name = db_data[i].name;
db_data[i] >> nb_prop;
i++;
for (int k=0;k < nb_prop;k++)
{
string &prop_name = db_data[i].name;
if (att_name == "velocity")
{
if (prop_name == "min")
db_data[i] >> vel_min;
else if (att_name == "max")
db_data[i] >> vel_max;
}
else
{
if (prop_name == "min")
db_data[i] >> acc_min;
else
db_data[i] >> acc_max;
}
i++;
}
}
Parameters
[in]class_nameThe class name
[in,out]dbThe property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_attribute_property_history()

vector<DbHistory> Tango::Database::get_class_attribute_property_history ( string &  class_name,
string &  att_name,
string &  prop_name 
)

Get class attribute property history from database.

Get the list of the last 10 modifications of the specifed class attribute property. Note that prop_name and att_name can contain a wildcard character (eg: "prop*"). An example of usage of a similar function can be found in the documentation of the get_property_history() function.

Parameters
[in]class_nameThe class name
[in]att_nameThe attribute name
[in]prop_nameThe property name
Returns
A vector of DbHistory instances
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_for_device()

string Tango::Database::get_class_for_device ( string &  dev_name)

Get class name for a device.

Return the class of the specified device.

string devname("sr/rf-cavity/1");
string classname = db->get_class_for_device(devname);
Parameters
[in]dev_nameThe device name
Returns
The device class name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_inheritance_for_device()

DbDatum Tango::Database::get_class_inheritance_for_device ( string &  dev_name)

Get device inheritance scheme.

Return the class inheritance scheme of the specified device

string devname("sr/rf-cavity/1");
DbDatum db_datum = db->get_class_inheritance_for_device(devname);
vector<string> class_list;
db_datum >> class_list;
Parameters
[in]dev_nameThe device name
Returns
The device inheritance
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_list()

DbDatum Tango::Database::get_class_list ( string &  wildcard)

Get Tango class list.

Query the database for a list of classes which match the specified wildcard.

string wildcard("Motor*");
DbDatum db_datum = db->get_class_list(wildcard);
vector<string> class_list;
db_datum >> class_list;
Parameters
[in]wildcardThe wildcard
Returns
The class list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_pipe_list()

DbDatum Tango::Database::get_class_pipe_list ( const string &  class_name,
const string &  wildcard 
)

Get class pipe list.

Query the database for a list of pipes defined for the specified class which match the specified wildcard.

string classname("MyClass");
string wildcard("*");
DbDatum db_datum = db->get_class_pipe_list(classname,wildcard);
vector<string> pipe_list;
db_datum >> pipe_list;
Parameters
[in]class_nameThe class name
[in]wildcardThe wildcard
Returns
The class pipe list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_pipe_property()

void Tango::Database::get_class_pipe_property ( string  class_name,
DbData &  db 
)
inline

Get class pipe property value.

Query the database for a list of class pipe properties for the specified object. The pipe names are specified by the vector of DbDatum structures. The method returns all the properties for the specified pipes. The pipe names are returned with the number of properties specified as their value. The first DbDatum element of the returned DbData vector contains the first pipe name and the first pipe property number. The following DbDatum element contains the first pipe property name and property values. To retrieve the properties use the extract operator >>. Here is an example of how to use the DbData type to specify and extract pipe properties :

DbData db_data;
db_data.push_back(DbDatum("pipe_image"));
db_data.push_back(DbDatum("pipe_misc"));
db->get_class_pipe_property("MyDetector", db_data);
int max_x, min_x, size;
for (int i=0; i< db_data.size(); i++)
{
long nb_prop;
string &pipe_name = db_data[i].name;
db_data[i] >> nb_prop;
i++;
for (int k=0;k < nb_prop;k++)
{
string &prop_name = db_data[i].name;
if (pipe_name == "pipe_image")
{
if (prop_name == "min_x")
db_data[i] >> min_x;
else if (att_name == "max_x")
db_data[i] >> max_x;
}
else
{
if (prop_name == "size")
db_data[i] >> size;
}
i++;
}
}
Parameters
[in]class_nameThe class name
[in,out]dbThe pipe/property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_pipe_property_history()

vector<DbHistory> Tango::Database::get_class_pipe_property_history ( string &  class_name,
string &  pipe_name,
string &  prop_name 
)

Get class pipe property history from database.

Get the list of the last 10 modifications of the specifed class pipe property. Note that prop_name and pipe_name can contain a wildcard character (eg: "prop*"). An example of usage of a similar function can be found in the documentation of the get_property_history() function.

Parameters
[in]class_nameThe class name
[in]pipe_nameThe pipe name
[in]prop_nameThe property name
Returns
A vector of DbHistory instances
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_property()

void Tango::Database::get_class_property ( string  class_name,
DbData &  db 
)
inline

Get class property value.

Query the database for a list of class properties. The property names are specified by the vector of DbDatum structures. The method returns the properties in the same DbDatum structures. To retrieve the properties use the extract operator >>. Here is an example of how to use the DbData type to specify and extract properties :

DbData db_data;
db_data.push_back(DbDatum("velocity"));
db_data.push_back(DbDatum("acceleration"));
db->get_class_property("StepperMotor", db_data);
float velocity, acceleration;
db_data[0] >> velocity;
db_data[1] >> acceleration;
Parameters
[in]class_nameThe class name
[in,out]dbThe property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_property_history()

vector<DbHistory> Tango::Database::get_class_property_history ( string &  class_name,
string &  prop_name 
)

Get class property history from database.

Get the list of the last 10 modifications of the specifed class property. Note that prop_name can contain a wildcard character (eg: "prop*"). An example of usage of a similar function can be found in the documentation of the get_property_history() function.

Parameters
[in]class_nameThe class name
[in]prop_nameThe property name
Returns
A vector of DbHistory instances
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_class_property_list()

DbDatum Tango::Database::get_class_property_list ( string &  class_name)

Get class property list.

Query the database for a list of properties defined for the specified class.

string classname("MyClass");
DbDatum db_datum = db->get_object_property_list(classname);
vector<string> prop_list;
db_datum >> prop_list;
Parameters
[in]class_nameThe class name
Returns
The class property list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_alias()

void Tango::Database::get_device_alias ( string  dev_alias,
string &  dev_name 
)

Get device name from its alias.

Deprecated:
use get_device_from_alias()

Get the device name from an alias. The device alias is specified by dev_alias and the device name is returned in dev_name. If there is no device with the given alias, a DevFailed exception is thrown.

Parameters
[in]dev_aliasThe device alias
[out]dev_nameThe device name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_alias_list()

DbDatum Tango::Database::get_device_alias_list ( string &  filter)

Get device alias list.

Get device alias list. The parameter is a string to filter the alias list returned. Wildcard (*) is supported. For instance, if the string passed as the method parameter is initialised with only the * character, all the defined device alias will be returned. The DbDatum returned by this method is initialised with an array of strings and must be extracted into a vector<string>. If there is no alias with the given filter, the returned array will have a 0 size.

DbData db_data;
string filter("*");
db_data = db->get_device_alias_list(filter);
vector<string> al_list;
db_data >> al_list;
cout << al_list.size() << " device alias defined in db" << endl;
for (int i=0;i < al_list.size();i++)
cout << "alias = " << al_list[i] << endl;
Parameters
[in]filterThe filter
Returns
The device alias list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_attribute_list()

void Tango::Database::get_device_attribute_list ( string &  dev_name,
vector< string > &  att_list 
)

Get list of attribute with data in database for a specific device.

Get the list of attribute(s) with some data defined in database for a specified device. Note that this is not the list of all device attributes because not all attribute(s) have some data in database

Parameters
[in]dev_nameThe device name
[in]att_listThe attribute name list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_attribute_property()

void Tango::Database::get_device_attribute_property ( string  dev_name,
DbData &  db 
)
inline

Get device attribute property value.

Query the database for a list of device attribute properties for the specified object. The attribute names are specified by the vector of DbDatum structures. The method returns all the properties for the specified attributes. The attribute names are returned with the number of properties specified as their value. The first DbDatum element of the returned DbData vector contains the first attribute name and the first attribute property number. The following DbDatum element contains the first attribute property name and property values. To retrieve the properties use the extract operator >>. Here is an example of how to use the DbData type to specify and extract attribute properties :

DbData db_data;
db_data.push_back(DbDatum("velocity"));
db_data.push_back(DbDatum("acceleration"));
db->get_device_attribute_property("id11/motor/1", db_data);
float vel_max, vel_min, acc_max, acc_min;
for (int i=0;i < db_data.size();i++)
{
long nb_prop;
string &att_name = db_data[i].name;
db_data[i] >> nb_prop;
i++;
for (int k=0;k < nb_prop;k++)
{
string &prop_name = db_data[i].name;
if (att_name == "velocity")
{
if (prop_name == "min")
db_data[i] >> vel_min;
else if (att_name == "max")
db_data[i] >> vel_max;
}
else
{
if (prop_name == "min")
db_data[i] >> acc_min;
else
db_data[i] >> acc_max;
}
i++;
}
}
Parameters
[in]dev_nameThe device name
[in,out]dbThe property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_attribute_property_history()

vector<DbHistory> Tango::Database::get_device_attribute_property_history ( string &  dev_name,
string &  prop_name,
string &  att_name 
)

Get device attribute property history from database.

Get the list of the last 10 modifications of the specifed device attribute property. Note that prop_name and att_name can contain a wildcard character (eg: "prop*"). An example of usage of a similar function can be found in the documentation of the get_property_history() function.

Parameters
[in]dev_nameThe device name
[in]prop_nameThe property name
[in]att_nameThe property name
Returns
A vector of DbHistory instances
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_class_list()

DbDatum Tango::Database::get_device_class_list ( string &  ds_name)

Get list of devices/classes for a specified device server.

Query the database for a list of devices and classes served by the specified server. Return a list with the following structure: {device name,class name,device name,class name,...}

string server("Serial/1");
DbDatum db_datum = db->get_device_class_list(server);
vector<string> dev_list;
db_datum >> dev_list;
Parameters
[in]ds_nameThe full device server process name
Returns
The device / class list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_domain()

DbDatum Tango::Database::get_device_domain ( string &  wildcard)

Get list of device domain names.

Query the database for a list of device domain names which match the wildcard provided. Wildcard character * matches any number of characters. Domain names are case insensitive.

Parameters
[in]wildcardThe wildcard
Returns
The device domain names list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_exported()

DbDatum Tango::Database::get_device_exported ( string &  filter)

Get list of exported devices.

Query the database for a list of exported devices whose names satisfy the supplied filter (* is wildcard for any character(s)).

Parameters
[in]filterThe filter
Returns
The list of exported devices
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_exported_for_class()

DbDatum Tango::Database::get_device_exported_for_class ( string &  class_name)

Get list of exported device for a class.

Query database for list of exported devices for the specified class.

string classname("MyClass");
DbDatum db_datum = db->get_device_exported_for_class(classname);
vector<string> dev_list;
db_datum >> dev_list;
Parameters
[in]class_nameThe Tango device class name
Returns
The exported device list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_family()

DbDatum Tango::Database::get_device_family ( string &  wildcard)

Get list of device family name.

Query the database for a list of device family names which match the wildcard provided. Wildcard character * matches any number of characters. Family names are case insensitive.

Parameters
[in]wildcardThe wildcard
Returns
The device family names list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_from_alias()

void Tango::Database::get_device_from_alias ( string  alias,
string &  dev_name 
)

Get device name from its alias.

Get the device name from its alias. The device alias is specified by alias and the device name is returned in dev_name. If there is no device defined with the given alias, a DevFailed exception is thrown.

Parameters
[in]aliasThe device alias
[out]dev_nameThe device name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_info()

DbDevFullInfo Tango::Database::get_device_info ( string &  dev_name)

Get device information.

Return miscellaneous device information from the database (not from the device itself)

Parameters
[in]dev_nameThe device name
Returns
The device information class instance
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_member()

DbDatum Tango::Database::get_device_member ( string &  wildcard)

Get list of device member name.

Query the database for a list of device member names which match the wildcard provided. Wildcard character * matches any number of characters. Member names are case insensitive.

Parameters
[in]wildcardThe wildcard
Returns
The device member names list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_name()

DbDatum Tango::Database::get_device_name ( string &  ds_name,
string &  class_name 
)

Get list of devices served by a device server process.

Query the database for a list of devices served by the specified server (1st parameter) and of the specified class (2nd parameter).

Parameters
[in]ds_nameThe device server name (executable/instance)
[in]class_nameThe class name
Returns
The list of devices
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_pipe_list()

void Tango::Database::get_device_pipe_list ( const string &  dev_name,
vector< string > &  pipe_list 
)

Get list of pipe with data in database for a specific device.

Get the list of pipe(s) with some data defined in database for a specified device. Note that this is not the list of all device pipes because not all pipe(s) have some data in database

Parameters
[in]dev_nameThe device name
[in]pipe_listThe pipe name list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_pipe_property()

void Tango::Database::get_device_pipe_property ( string  dev_name,
DbData &  db 
)
inline

Get device pipe property value.

Query the database for a list of device pipe properties for the specified object. The pipe names are specified by the vector of DbDatum structures. The method returns all the properties for the specified pipes. The pipe names are returned with the number of properties specified as their value. The first DbDatum element of the returned DbData vector contains the first pipe name and the first pipe property number. The following DbDatum element contains the first pipe property name and property values. To retrieve the properties use the extract operator >>. Here is an example of how to use the DbData type to specify and extract pipe properties :

DbData db_data;
db_data.push_back(DbDatum("velocity"));
db_data.push_back(DbDatum("acceleration"));
db->get_device_pipe_property("id11/motor/1", db_data);
float vel_max, vel_min, acc_max, acc_min;
for (int i=0;i < db_data.size();i++)
{
long nb_prop;
string &pipe_name = db_data[i].name;
db_data[i] >> nb_prop;
i++;
for (int k=0;k < nb_prop;k++)
{
string &prop_name = db_data[i].name;
if (pipe_name == "velocity")
{
if (prop_name == "min")
db_data[i] >> vel_min;
else if (att_name == "max")
db_data[i] >> vel_max;
}
else
{
if (prop_name == "min")
db_data[i] >> acc_min;
else
db_data[i] >> acc_max;
}
i++;
}
}
Parameters
[in]dev_nameThe device name
[in,out]dbThe pipe/property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_pipe_property_history()

vector<DbHistory> Tango::Database::get_device_pipe_property_history ( string &  dev_name,
string &  pipe_name,
string &  prop_name 
)

Get device pipe property history from database.

Get the list of the last 10 modifications of the specifed device pipe property. Note that prop_name and pipe_name can contain a wildcard character (eg: "prop*"). An example of usage of a similar function can be found in the documentation of the get_property_history() function.

Parameters
[in]dev_nameThe device name
[in]pipe_nameThe property name
[in]prop_nameThe pipe name
Returns
A vector of DbHistory instances
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_property()

void Tango::Database::get_device_property ( string  dev_name,
DbData &  db 
)
inline

Get device property value.

Query the database for a list of device properties for the specified object. The property names are specified by the vector of DbDatum structures. The method returns the properties in the same DbDatum structures. To retrieve the properties use the extract operator >>. Here is an example of how to use the DbData type to specify and extract properties :

DbData db_data;
db_data.push_back(DbDatum(“velocity”));
db_data.push_back(DbDatum(“acceleration”));
db->get_device_property(“id11/motor/1”, db_data);
float velocity, acceleration;
db_data[0] >> velocity;
db_data[1] >> acceleration;
Parameters
[in]dev_nameThe device name
[in,out]dbThe property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_property_history()

vector<DbHistory> Tango::Database::get_device_property_history ( string &  dev_name,
string &  prop_name 
)

Get device property history from database.

Get the list of the last 10 modifications of the specifed device property. Note that prop_name can contain a wildcard character (eg: "prop*"). An example of usage of a similar function can be found in the documentation of the get_property_history() function.

Parameters
[in]dev_nameThe device name
[in]prop_nameThe property name
Returns
A vector of DbHistory instances
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_device_service_list()

DbDatum Tango::Database::get_device_service_list ( string &  service_name)

Get services list from database.

Query database for specified services. The vector of strings returned in the DbDatum object contains pair of strings <instance_name> followed by <device name>.

string servicename("HdbManager");
DbDatum db_datum = db->get_device_service_list(servicename);
vector<string> service_device_list;
db_datum >> service_device_list;
Parameters
[in]service_nameThe service name
Returns
A service/device list matching the input parameter
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_host_list() [1/2]

DbDatum Tango::Database::get_host_list ( )

Get host list.

Returns the list of all host names registered in the database.

DbDatum db_datum = db->get_host_list();
vector<string> host_list;
db_datum >> host_list;
Returns
A host name list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_host_list() [2/2]

DbDatum Tango::Database::get_host_list ( string &  wildcard)

Get host list with name matching a wildcard.

Returns the list of all host names registered in the database which match the specified wildcard (eg: "lc0*")

string wildcard("l-c0*");
DbDatum db_datum = db->get_host_list(wildcard);
vector<string> host_list;
db_datum >> host_list;
Parameters
[in]wildcardThe wildcard
Returns
A host name list matching the input
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_host_server_list()

DbDatum Tango::Database::get_host_server_list ( string &  host_name)

Get list of device server processes running on a host.

Query the database for a list of servers registred on the specified host.

string host("kidiboo");
DbDatum db_datum = db->get_host_server_list(wildcard);
vector<string> server_list;
db_datum >> server_list;
Parameters
[in]host_nameThe host name
Returns
The list of device server processes
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_info()

string Tango::Database::get_info ( )

Get database info.

Query the database for some general info about the tables in the database. Result is returned as a string. Example :

cout << db->get_info() << endl;

will return information like this:

Running since 2000-11-06 14:10:46
Devices defined = 115
Devices exported = 41
Device servers defined = 47
Device servers exported = 17
Class properties defined = 5
Device properties defined = 130
Class attribute properties defined = 20
Device attribute properties defined = 92
Returns
The string giving database info
Exceptions
ConnectionFailed,CommunnicationFailed,DevFailedfrom device

◆ get_instance_name_list()

DbDatum Tango::Database::get_instance_name_list ( string &  ds_name)

Get list of instances.

Return the list of all instance names existing in the database for the specifed server.

string servername("Serial");
DbDatum db_datum = db->get_instance_name_list(servername);
vector<string> instance_list;
db_datum >> instance_list;
Parameters
[in]ds_nameThe device server process executable name
Returns
The list of all instances for the specified device server process
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_object_list()

DbDatum Tango::Database::get_object_list ( string &  wildcard)

Get object (free property) list.

Query the database for a list of object (free properties) for which properties are defined and which match the specified wildcard.

string wildcard("Optic*");
DbDatum db_datum = db->get_object_list(wildcard);
vector<string> obj_list;
db_datum >> obj_list;
Parameters
[in]wildcardThe wildcard
Returns
The object (free property) list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_object_property_list()

DbDatum Tango::Database::get_object_property_list ( string &  obj_name,
string &  wildcard 
)

Get object property list.

Query the database for a list of properties defined for the specified object and which match the specified wildcard.

string objname("OpticID9");
string wildcard("Delta*");
DbDatum db_datum = db->get_object_property_list(objname,wildcard);
vector<string> prop_list;
db_datum >> prop_list;
Parameters
[in]obj_nameThe object (free property) name
[in]wildcardThe wildcard
Returns
The object (free property) property list
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_property()

void Tango::Database::get_property ( string  obj_name,
DbData &  db 
)
inline

Get object property value.

Query the database for a list of object (i.e. non-device) properties for the specified object. The property names are specified by the vector of DbDatum structures. The method returns the properties in the same DbDatum structures. To retrieve the properties use the extract operator >>. Here is an example of how to use the DbData type to specify and extract properties :

DbData db_data;
db_data.push_back(DbDatum(“velocity”));
db_data.push_back(DbDatum(“acceleration”));
db->get_property(“mymotor”, db_data);
float velocity, acceleration;
db_data[0] >> velocity;
db_data[1] >> acceleration;
Parameters
[in]obj_nameThe object (free property) name
[in,out]dbThe property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_property_history()

vector<DbHistory> Tango::Database::get_property_history ( string &  obj_name,
string &  prop_name 
)

Get object property history from database.

Get the list of the last 10 modifications of the specifed object property. Note that propname can contain a wildcard character (eg: "prop*").

vector<DbHistory> hist;
DbDatum result;
string objname("jlptest");
string propname("test_prop");
hist = db->get_property_history(objname,propname);
// Print the modification history of the specified property
for(int i=0;i<hist.size();i++)
{
cout << "Name:" << hist[i].get_name() << endl;
cout << "Date:" << hist[i].get_date() << endl;
if( hist[i].is_deleted() )
{
cout << "Deleted !" << endl;
}
else
{
hist[i].get_value() >> result;
for (int j=0; j<result.size(); j++)
cout << "Value:" << result[j] << endl;
}
}
Parameters
[in]obj_nameThe object (free property) name
[in]prop_nameThe property name
Returns
A vector of DbHistory instances
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_server_class_list()

DbDatum Tango::Database::get_server_class_list ( string &  ds_name)

Get list of Tango classes embedded in a device server proess.

Query the database for a list of classes instancied by the specified server. The DServer class exists in all TANGO servers and for this reason this class is removed from the returned list.

string server("Serial/1");
DbDatum db_datum = db->get_server_class_list(server);
vector<string> class_list;
db_datum >> class_list;
Parameters
[in]ds_nameThe full device server process name
Returns
The list of Tango classes embedded in the specified server process
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_server_list() [1/2]

DbDatum Tango::Database::get_server_list ( )

Get list of device server processes.

Return the list of all servers registered in the database.

DbDatum db_datum = db->get_server_list();
vector<string> server_list;
db_datum >> server_list;
Returns
The list of all device server processes defined in database
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_server_list() [2/2]

DbDatum Tango::Database::get_server_list ( string &  wildcard)

Get list of device server processes with a wildcard.

Return the list of all servers registered in the database which match the specified wildcard (eg: "Serial/l*").

string wildcard("Serial/l*");
DbDatum db_datum = db->get_server_list(wildcard);
vector<string> server_list;
db_datum >> server_list;
Parameters
[in]wildcardThe wildcard
Returns
The list of device server processes defined in database matching the specified wildcard
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_server_name_list()

DbDatum Tango::Database::get_server_name_list ( )

Get list of all Tango device server process.

Return the list of all server names registered in the database.

DbDatum db_datum = db->get_server_name_list();
vector<string> server_list;
db_datum >> server_list;
Returns
The list of all server names
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_services()

DbDatum Tango::Database::get_services ( string &  service_name,
string &  inst_name 
)

Get services list from database.

Query database for specified services. The instname parameter can be a wildcard character ("*").

string servicename("HdbManager");
string instname("ctrm");
DbDatum db_datum = db->get_services(servicename,instname);
vector<string> service_list;
db_datum >> service_list;
Parameters
[in]service_nameThe service name
[in]inst_nameThe instance name
Returns
A service list matching the input parameters
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ import_device()

DbDevImportInfo Tango::Database::import_device ( string &  dev_name)

Import a device from the database.

Query the database for the export info of the specified device. The command returns the information in a DbDevImportInfo structure. Example :

DbDevImportInfo my_device_import;
my_device_import = db->import_device(“my/own/device”);
cout << “ device ” << my_device_import.name;
cout << “exported ” << my_device_import.exported;
cout << “ior ” << my_device_import.ior;
cout << “version ” << my_device_import.version;
cout << endl;
Parameters
[in]dev_nameThe device name
Returns
One instance of a DbDevImportInfo class
Exceptions
ConnectionFailed,CommunicationFailed,DevFailed

◆ put_attribute_alias()

void Tango::Database::put_attribute_alias ( string &  att_name,
string &  att_alias 
)

Define attribute alias.

Set an alias for an attribute name. The attribute alias is specified by att_alias and the attribute name is specifed by att_name. If the given alias already exists, a DevFailed exception is thrown.

Parameters
[in]att_nameThe attribute name
[in]att_aliasThe attribute alias
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ put_class_attribute_property()

void Tango::Database::put_class_attribute_property ( string  class_name,
DbData &  db 
)

Put class attribute property value in database.

Insert or update a list of attribute properties for the specified class. The attribute property names and their values are specified by the vector of DbDatum structures. Use the insert operator >> to insert the properties into the DbDatum structures. Here is an example of how to insert/update min, max properties for attribute velocity and min, max properties for attribute acceleration properties belonging to class StepperMotor into the database using this method :

DbDatum velocity("velocity"), vel_min("min"), vel_max("max");
DbDatum acceleration("acceleration"), acc_min("min"), acc_max("max");
DbData db_data;
velocity << 2;
vel_min << 0.0;
vel_max << 1000000.0;
db_data.push_back(velocity);
db_data.push_back(vel_min);
db_data.push_back(vel_max);
acceleration << 2;
acc_min << 0.0;
acc_max << 8000000;
db_data.push_back(acceleration);
db_data.push_back(acc_min);
db_data.push_back(acc_max);
db->put_class_attribute_property("StepperMotor", db_data);
Parameters
[in]class_nameThe class name
[in]dbThe property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ put_class_pipe_property()

void Tango::Database::put_class_pipe_property ( string  class_name,
DbData &  db 
)

Put class pipe property value in database.

Insert or update a list of pipe properties for the specified class. The pipe property names and their values are specified by the vector of DbDatum structures. Use the insert operator >> to insert the properties into the DbDatum structures. Here is an example of how to insert/update min, max properties for pipe velocity and min, max properties for pipe acceleration properties belonging to class StepperMotor into the database using this method :

DbDatum velocity("velocity"), vel_min("min"), vel_max("max");
DbDatum acceleration("acceleration"), acc_min("min"), acc_max("max");
DbData db_data;
velocity << 2;
vel_min << 0.0;
vel_max << 1000000.0;
db_data.push_back(velocity);
db_data.push_back(vel_min);
db_data.push_back(vel_max);
acceleration << 2;
acc_min << 0.0;
acc_max << 8000000;
db_data.push_back(acceleration);
db_data.push_back(acc_min);
db_data.push_back(acc_max);
db->put_class_pipe_property("StepperMotor", db_data);
Parameters
[in]class_nameThe class name
[in]dbThe pipe/property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ put_class_property()

void Tango::Database::put_class_property ( string  class_name,
DbData &  db 
)

Put class property value in database.

Insert or update a list of properties for the specified class. The property names and their values are specified by the vector of DbDatum structures. Use the insert operator >> to insert the properties into the DbDatum structures. Here is an example of how to insert properties into the database using this method :

DbDatum velocity("velocity"), acceleration("acceleration");
DbData db_data;
velocity << 100000.0;
acceleration << 500000.0;
db_data.push_back(velocity);
db_data.push_back(acceleration);
db->put_class_property("StepperMotor", db_data);
Parameters
[in]class_nameThe class name
[in]dbThe property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ put_device_alias()

void Tango::Database::put_device_alias ( string &  dev_name,
string &  dev_alias 
)

Define device alias.

Create a device alias. Alias name has to be uniq within a Tango control system and you will receive an exception if the alias is already defined.

Parameters
[in]dev_nameThe device name
[in]dev_aliasThe device alias
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ put_device_attribute_property()

void Tango::Database::put_device_attribute_property ( string  dev_name,
DbData &  db 
)

Put device attribute property value in database.

Insert or update a list of attribute properties for the specified device. The attribute property names and their values are specified by the vector of DbDatum structures. Use the insert operator >> to insert the properties into the DbDatum structures. Here is an example of how to insert/update properties min, max for attribute velocity and properties min, max for attribute acceleration of device id11/motor/1 into the database using this method :

DbDatum vel("velocity"); // We want to put properties for attribute "velocity"
DbDatum vel_min("min"), vel_max("max");
DbDatum acc("acceleration") // We want to put properties for attribute "acceleration"
DbDatum acc_min("min"), acc_max("max");
DbData db_data;
vel << 2; // Two properties for attribute "velocity"
vel_min << 0.0; // Value for property min
vel_max << 1000000.0; // Value for property max
db_data.push_back(vel);
db_data.push_back(vel_min);
db_data.push_back(vel_max);
acc << 2; // Two properties for attribute "acceleration"
acc_min << 0.0; // Value for property min
acc_max << 8000000; // Value for property max
db_data.push_back(acc);
db_data.push_back(acc_min);
db_data.push_back(acc_max);
db->put_device_attribute_property(“id11/motor/1”, db_data);
Parameters
[in]dev_nameThe device name
[in]dbThe property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ put_device_pipe_property()

void Tango::Database::put_device_pipe_property ( string  dev_name,
DbData &  db 
)

Put device pipe property value in database.

Insert or update a list of pipe properties for the specified device. The pipe property names and their values are specified by the vector of DbDatum structures. Use the insert operator >> to insert the properties into the DbDatum structures. Here is an example of how to insert/update properties min, max for pipe velocity and properties min, max for pipe acceleration of device id11/motor/1 into the database using this method :

DbDatum vel("velocity"); // We want to put properties for pipe "velocity"
DbDatum vel_min("min"), vel_max("max");
DbDatum acc("acceleration") // We want to put properties for pipe "acceleration"
DbDatum acc_min("min"), acc_max("max");
DbData db_data;
vel << 2; // Two properties for pipe "velocity"
vel_min << 0.0; // Value for property min
vel_max << 1000000.0; // Value for property max
db_data.push_back(vel);
db_data.push_back(vel_min);
db_data.push_back(vel_max);
acc << 2; // Two properties for pipe "acceleration"
acc_min << 0.0; // Value for property min
acc_max << 8000000; // Value for property max
db_data.push_back(acc);
db_data.push_back(acc_min);
db_data.push_back(acc_max);
db->put_device_pipe_property(“id11/motor/1”, db_data);
Parameters
[in]dev_nameThe device name
[in]dbThe pipe/property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ put_device_property()

void Tango::Database::put_device_property ( string  dev_name,
DbData &  db 
)

Put device property value in database.

Insert or update a list of properties for the specified device. The property names and their values are specified by the vector of DbDatum structures. Use the insert operator >> to insert the properties into the DbDatum structures. Here is an example of how to insert properties into the database using this method :

DbDatum velocity(“velocity”), acceleration(“acceleration”);
DbData db_data;
velocity << 100000.0;
acceleration << 500000.0;
db_data.push_back(velocity);
db_data.push_back(acceleration);
db->put_device_property(“id11/motor/1”, db_data);
Parameters
[in]dev_nameThe device name
[in]dbThe property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ put_property()

void Tango::Database::put_property ( string  obj_name,
DbData &  db 
)

Put object property value in database.

Insert or update a list of properties for the specified object. The property names and their values are specified by the vector of DbDatum structures. Use the insert operator >> to insert the properties into the DbDatum structures. Here is an example of how to insert properties into the database using this method :

DbDatum velocity(“velocity”), acceleration(“acceleration”);
DbData db_data;
velocity << 100000.0;
acceleration << 500000.0;
db_data.push_back(velocity);
db_data.push_back(acceleration);
db->put_property(“mymotor”, db_data);
Parameters
[in]obj_nameThe object (free property) name
[in]dbThe property names and values
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ register_service()

void Tango::Database::register_service ( string &  service_name,
string &  inst_name,
string &  dev_name 
)

Register a service in the database.

Register the specified service wihtin the database.

string servicename("HdbManager");
string instname("ctrm");
string devname("sys/hdb/1");
db->register_service(servicename,instname,devname);
Parameters
[in]service_nameThe service name
[in]inst_nameThe instance name
[in]dev_nameThe device name implementing the service
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ rename_server()

void Tango::Database::rename_server ( const string &  old_ds_name,
const string &  new_ds_name 
)

Rename a device server in the database.

Rename a device server process in the database.

Parameters
[in]old_ds_nameThe old device server process name
[in]new_ds_nameThe new device server process name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device (DB_SQLError)

◆ unexport_device()

void Tango::Database::unexport_device ( string  dev_name)

Unexport a device in the database.

Mark the specified device as un-exported in the database. Example :

db->unexport_device(“my/own/device”);
Parameters
[in]dev_nameThe device name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device (DB_SQLError)

◆ unexport_server()

void Tango::Database::unexport_server ( string &  ds_name)

Unexport all devices from a device server in the database.

Mark all devices exported for this device server process as unexported.

Parameters
[in]ds_nameThe full device server process name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device (DB_SQLError)

◆ unregister_service()

void Tango::Database::unregister_service ( string &  service_name,
string &  inst_name 
)

Unregister a service from the database.

Unregister the specified service from the database.

string servicename("HdbManager");
string instname("ctrm");
db->unregister_service(servicename,instname);
Parameters
[in]service_nameThe service name
[in]inst_nameThe instance name
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

The documentation for this class was generated from the following file:
Tango::Database::delete_class_attribute_property
void delete_class_attribute_property(string class_name, DbData &db)
Delete class attribute property from database.
Tango::Database::put_property
void put_property(string obj_name, DbData &db)
Put object property value in database.
Tango::Database::Database
Database(CORBA::ORB *orb=NULL)
Create a TANGO Database object.
Tango::Database::put_device_attribute_property
void put_device_attribute_property(string dev_name, DbData &db)
Put device attribute property value in database.
Tango::Database::get_device_class_list
DbDatum get_device_class_list(string &ds_name)
Get list of devices/classes for a specified device server.
Tango::Database::put_class_pipe_property
void put_class_pipe_property(string class_name, DbData &db)
Put class pipe property value in database.
Tango::Database::get_object_property_list
DbDatum get_object_property_list(string &obj_name, string &wildcard)
Get object property list.
Tango::Database::register_service
void register_service(string &service_name, string &inst_name, string &dev_name)
Register a service in the database.
Tango::Database::put_class_attribute_property
void put_class_attribute_property(string class_name, DbData &db)
Put class attribute property value in database.
Tango::Database::import_device
DbDevImportInfo import_device(string &dev_name)
Import a device from the database.
Tango::Database::get_class_pipe_list
DbDatum get_class_pipe_list(const string &class_name, const string &wildcard)
Get class pipe list.
Tango::DbDevImportInfo::name
string name
The device name.
Definition: dbapi.h:818
Tango::Database::get_class_list
DbDatum get_class_list(string &wildcard)
Get Tango class list.
Tango::Database::get_info
string get_info()
Get database info.
Tango::Database::delete_device_property
void delete_device_property(string dev_name, DbData &db)
Delete device property from database.
Tango::Database::get_class_pipe_property
void get_class_pipe_property(string class_name, DbData &db)
Get class pipe property value.
Definition: dbapi.h:1187
Tango::Database::get_object_list
DbDatum get_object_list(string &wildcard)
Get object (free property) list.
Tango::Database::delete_property
void delete_property(string obj_name, DbData &db)
Delete object property from database.
Tango::Database::get_server_class_list
DbDatum get_server_class_list(string &ds_name)
Get list of Tango classes embedded in a device server proess.
Tango::Database::unregister_service
void unregister_service(string &service_name, string &inst_name)
Unregister a service from the database.
Tango::Database::get_property_history
vector< DbHistory > get_property_history(string &obj_name, string &prop_name)
Get object property history from database.
Tango::Database::export_device
void export_device(DbDevExportInfo &info)
Export a device into the database.
Tango::Database
A high level object which contains the link to the database.
Definition: dbapi.h:53
Tango::Database::get_device_service_list
DbDatum get_device_service_list(string &service_name)
Get services list from database.
Tango::Database::get_server_name_list
DbDatum get_server_name_list()
Get list of all Tango device server process.
Tango::Database::delete_device_attribute_property
void delete_device_attribute_property(string dev_name, DbData &db)
Delete device attribute property from database.
Tango::Database::get_device_exported_for_class
DbDatum get_device_exported_for_class(string &class_name)
Get list of exported device for a class.
Tango::Database::get_instance_name_list
DbDatum get_instance_name_list(string &ds_name)
Get list of instances.
Tango::Database::get_class_inheritance_for_device
DbDatum get_class_inheritance_for_device(string &dev_name)
Get device inheritance scheme.
Tango::Database::put_class_property
void put_class_property(string class_name, DbData &db)
Put class property value in database.
Tango::Database::get_host_list
DbDatum get_host_list()
Get host list.
Tango::Database::delete_class_property
void delete_class_property(string class_name, DbData &db)
Delete class property from database.
Tango::Database::delete_class_pipe_property
void delete_class_pipe_property(string class_name, DbData &db)
Delete class pipe property from database.
Tango::Database::put_device_pipe_property
void put_device_pipe_property(string dev_name, DbData &db)
Put device pipe property value in database.
Tango::Database::get_device_alias_list
DbDatum get_device_alias_list(string &filter)
Get device alias list.
Tango::Database::get_class_property
void get_class_property(string class_name, DbData &db)
Get class property value.
Definition: dbapi.h:944
Tango::Database::get_class_attribute_property
void get_class_attribute_property(string class_name, DbData &db)
Get class attribute property value.
Definition: dbapi.h:1058
Tango::Database::get_property
void get_property(string obj_name, DbData &db)
Get object property value.
Definition: dbapi.h:456
Tango::Database::get_class_attribute_list
DbDatum get_class_attribute_list(string &class_name, string &wildcard)
Get class attribute list.
Tango::Database::get_device_property
void get_device_property(string dev_name, DbData &db)
Get device property value.
Definition: dbapi.h:566
Tango::Database::get_host_server_list
DbDatum get_host_server_list(string &host_name)
Get list of device server processes running on a host.
Tango::Database::get_server_list
DbDatum get_server_list()
Get list of device server processes.
Tango::Database::put_device_property
void put_device_property(string dev_name, DbData &db)
Put device property value in database.
Tango::Database::add_device
void add_device(DbDevInfo &dev_info)
Add a device into the database.
Tango::Database::get_device_attribute_property
void get_device_attribute_property(string dev_name, DbData &db)
Get device attribute property value.
Definition: dbapi.h:680
Tango::Database::get_class_for_device
string get_class_for_device(string &dev_name)
Get class name for a device.
Tango::Database::get_services
DbDatum get_services(string &service_name, string &inst_name)
Get services list from database.
Tango::Database::get_device_pipe_property
void get_device_pipe_property(string dev_name, DbData &db)
Get device pipe property value.
Definition: dbapi.h:839
Tango::Database::unexport_device
void unexport_device(string dev_name)
Unexport a device in the database.
Tango::Database::delete_device
void delete_device(string dev_name)
Delete a device from the database.