Tango Core Classes Reference
9.3.3
|
High level class allowing the user to handle Tango group. More...
#include "tango.h"
Inherits Tango::GroupElement.
Public Member Functions | |
Constructor and destructor | |
Group (const std::string &name) | |
Create a Group instance. More... | |
virtual | ~Group () |
Create a Group instance. More... | |
Group management related methods | |
virtual void | add (Group *group, int tmo_ms=-1) |
Attaches a (sub) group. More... | |
virtual void | add (const std::string &pattern, int tmo_ms=-1) |
Attaches any device which name matches the specified pattern. More... | |
virtual void | add (const std::vector< std::string > &patterns, int tmo_ms=-1) |
Attaches any device which name matches one of the specified pattern. More... | |
virtual void | remove (const std::string &pattern, bool fwd=true) |
Removes any group or device which name matches the specified pattern. More... | |
virtual void | remove (const std::vector< std::string > &patterns, bool fwd=true) |
Removes any group or device which name matches any of the specified patterns. More... | |
virtual void | remove_all () |
Removes all elements in the group. More... | |
virtual bool | contains (const std::string &pattern, bool fwd=true) |
Check if the hierarchy contains groups and/or devices which name matches the specified pattern. More... | |
virtual DeviceProxy * | get_device (const std::string &device_name) |
Returns a reference to the specified device. More... | |
virtual DeviceProxy * | get_device (long idx) |
Returns a reference to the "idx-th" device in the hierarchy. More... | |
virtual DeviceProxy * | operator[] (long idx) |
Returns a reference to the "idx-th" device in the hierarchy. More... | |
virtual Group * | get_group (const std::string &group_name) |
Returns a reference to the specified group. More... | |
long | get_size (bool fwd=true) |
Return the number of devices in the hierarchy. More... | |
std::vector< std::string > | get_device_list (bool fwd=true) |
Returns the list of devices currently in the hierarchy. More... | |
a la Deviceproxy interface | |
virtual bool | ping (bool fwd=true) |
Ping all devices in a group. More... | |
virtual void | set_timeout_millis (int tmo_ms) |
Set client side timeout for all devices in the group. More... | |
GroupCmdReplyList | command_inout (const std::string &c, bool fwd=true) |
Executes a Tango command on a group. More... | |
GroupCmdReplyList | command_inout (const std::string &c, const DeviceData &d, bool fwd=true) |
Executes a Tango command with the same input data on a group. More... | |
GroupCmdReplyList | command_inout (const std::string &c, const std::vector< DeviceData > &d, bool fwd=true) |
Executes a Tango command with the different input data on a group (Using DeviceData class instances) More... | |
template<typename T > | |
GroupCmdReplyList | command_inout (const std::string &c, const std::vector< T > &d, bool fwd=true) |
Executes a Tango command with the different input data on a group. More... | |
long | command_inout_asynch (const std::string &c, bool fgt=false, bool fwd=true) |
Executes a Tango command on each device in the group asynchronously. More... | |
long | command_inout_asynch (const std::string &c, const DeviceData &d, bool fgt=false, bool fwd=true) |
Executes a Tango command with same input data on each device in the group asynchronously. More... | |
long | command_inout_asynch (const std::string &c, const std::vector< DeviceData > &d, bool fgt=false, bool fwd=true) |
Executes a Tango command with different input data (using DeviceData object) on each device in the group asynchronously. More... | |
template<typename T > | |
long | command_inout_asynch (const std::string &c, const std::vector< T > &d, bool fgt=false, bool fwd=true) |
Executes a Tango command with different input data on each device in the group asynchronously. More... | |
GroupCmdReplyList | command_inout_reply (long req_id, long tmo_ms=0) |
Returns the results of an asynchronous command. More... | |
GroupAttrReplyList | read_attribute (const std::string &a, bool fwd=true) |
Reads an attribute on each device in the group. More... | |
GroupAttrReplyList | read_attributes (const std::vector< std::string > &al, bool fwd=true) |
Reads several attributes on each device in the group. More... | |
long | read_attribute_asynch (const std::string &a, bool fwd=true) |
Reads an attribute on each device in the group asynchronously. More... | |
long | read_attributes_asynch (const std::vector< std::string > &al, bool fwd=true) |
Reads several attributes on each device in the group asynchronously. More... | |
GroupAttrReplyList | read_attribute_reply (long req_id, long tmo_ms=0) |
Returns the results of an asynchronous attribute reading. More... | |
GroupAttrReplyList | read_attributes_reply (long req_id, long tmo_ms=0) |
Returns the results of an asynchronous attributes reading. More... | |
GroupReplyList | write_attribute (const DeviceAttribute &d, bool fwd=true) |
Writes an attribute on each device in the group. More... | |
GroupReplyList | write_attribute (const std::vector< DeviceAttribute > &d, bool fwd=true) |
Writes several attributes on each device in the group (using DeviceAttribute) More... | |
template<typename T > | |
GroupReplyList | write_attribute (const std::string &n, const std::vector< T > &d, bool fwd=true) |
Writes one attributes on each device in the group with specific value per device. More... | |
long | write_attribute_asynch (const DeviceAttribute &d, bool fwd=true) |
Writes an attribute on each device in the group asynchronously. More... | |
long | write_attribute_asynch (const std::vector< DeviceAttribute > &d, bool fwd=true) |
Writes several attributes on each device in the group asynchronously. More... | |
template<typename T > | |
long | write_attribute_asynch (const std::string &a, const std::vector< T > &d, bool fwd=true) |
Writes an attribute on each device in the group asynchronously (Without DeviceAttribute data) More... | |
GroupReplyList | write_attribute_reply (long req_id, long tmo_ms=0) |
Returns the acknowledgements of an asynchronous attribute writing. More... | |
High level class allowing the user to handle Tango group.
$Author$ $Revision$
Tango::Group::Group | ( | const std::string & | name | ) |
Create a Group instance.
Instanciate an empty group. The group name allows retrieving a sub-group in the hierarchy.
name | The group name |
|
virtual |
Create a Group instance.
Delete a group and all its elements. Be aware that a group always gets the ownership of its children and deletes themwhen it is itself deleted. Therefore, never try to delete a Group (respectively a DeviceProxy) returned by a call to Tango::Group::get_group() (respectively to Tango::Group::get_device()). Use the Tango::Group::remove() method instead.
|
virtual |
Attaches any device which name matches the specified pattern.
The pattern parameter can be a simple device name or a device name pattern (e.g. domain_* / family/ member_*). This method first asks to the Tango database the list of device names matching the pattern. Devices are then attached to the group in the order in which they are returned by the database. Any device already present in the hierarchy (i.e. a device belonging to the group or to one of its subgroups) is silently ignored but its client side timeout is set to timeout_ms milliseconds if timeout_ms is different from -1. Set the client side timeout of each device matching the specified pattern to timeout_ms milliseconds if timeout_ms is different from -1.
[in] | pattern | The device selection pattern |
[in] | tmo_ms | The timeout value |
|
virtual |
Attaches any device which name matches one of the specified pattern.
The patterns parameter can be an array of device names and/or device name patterns. Thismethod first asks to the Tango database the list of device namesmatching one the patterns. Devices are then attached to the group in the order in which they are returned by the database. Any device already present in the hierarchy (i.e. a device belonging to the group or to one of its subgroups), is silently ignored but its client side timeout is set to timeout_ms milliseconds if timeout_ms is different from -1. If timeout_ms is different from -1, the client side timeouts of all devices matching the specified patterns are set to timeout_ms milliseconds.
[in] | patterns | The device selection pattern list |
[in] | tmo_ms | The timeout value |
|
virtual |
Attaches a (sub) group.
Be aware that a group always gets the ownership of its children and deletes them when it is itself deleted. Therefore, never try to delete a Group attached to a Group. Use the Group::remove() method instead. If timeout_ms parameter is different from -1, the client side timeout associated to each device composing the group added is set to timeout_ms milliseconds. If timeout_ms is -1, timeouts are not changed. This method does nothing if the specified group is already attached (i.e. it is silently ignored) and timeout_ms = -1. If the specified group is already attached and timeout_ms is different from -1, the client side timeout of each device composing the group given in parameter is set to timeout_ms milliseconds.
[in] | group | The group to be attached |
[in] | tmo_ms | The timeout value |
GroupCmdReplyList Tango::Group::command_inout | ( | const std::string & | c, |
bool | fwd = true |
||
) |
Executes a Tango command on a group.
Executes a Tango command on a group. This method is synchronous and does not return until replies are obtained or timeouts occurred. The parameter c is the name of the command. If fwd is set to true (the default), the request is also forwarded to subgroups. Otherwise, it is only applied to the local set of devices. Command results are returned in a GroupCmdReplyList. See Obtaining command result for details (Chapter 4.7.3.1 in Tango book). See also Case 1 of executing a command (Chapter 4.7.3.2 in Tango book) for an example.
[in] | c | The command name |
[in] | fwd | The forward flag |
GroupCmdReplyList Tango::Group::command_inout | ( | const std::string & | c, |
const DeviceData & | d, | ||
bool | fwd = true |
||
) |
Executes a Tango command with the same input data on a group.
Executes a Tango command on each device in the group. This method is synchronous and does not return until replies are obtained or timeouts occurred. The parameter c is the name of the command. The second parameter d is a Tango generic container for command carrying the command argument. See the Tango::DeviceData documentation. If fwd is set to true (the default), the request is also forwarded to subgroups. Otherwise, it is only applied to the local set of devices. Command results are returned in a GroupCmdReplyList. See Obtaining command results (Chapter 4.7.3.1 in Tango book) for details. See also Case 2 of executing a command (Chapter 4.7.3.4 in Tango book) for an example.
[in] | c | The command name |
[in] | d | The command data |
[in] | fwd | The forward flag |
GroupCmdReplyList Tango::Group::command_inout | ( | const std::string & | c, |
const std::vector< DeviceData > & | d, | ||
bool | fwd = true |
||
) |
Executes a Tango command with the different input data on a group (Using DeviceData class instances)
Executes a Tango command on each device in the group. This method is synchronous and does not return until replies are obtained or timeouts occurred. This implementation of command_inout allows passing a specific input argument to each device in the group. In order to use this form of command_inout, the user must have an "a priori" and "perfect" knowledge of the devices order in the group.
The parameter c is the name of the command. The std::vector d contains a specific argument value for each device in the group. Its size must equal Group::get_size(fwd). Otherwise, an exception is thrown. The order of the argument values must follows the order of the devices in the group (d[0] => 1st device, d[1] => 2nd device and so on). If fwd is set to true (the default), the request is also forwarded to subgroups. Otherwise, it is only applied to the local set of devices. Command results are returned in a GroupCmdReplyList. See Obtaining command results (Chpater 4.7.3.1 in Tango book) for details. See also Case 3 of executing a command (Chapter 4.7.3.5 in Tango book) for an example of this special form of command_inout.
[in] | c | The command name |
[in] | d | The command data |
[in] | fwd | The forward flag |
GroupCmdReplyList Tango::Group::command_inout | ( | const std::string & | c, |
const std::vector< T > & | d, | ||
bool | fwd = true |
||
) |
Executes a Tango command with the different input data on a group.
Executes a Tango command on each device in the group. This method is synchronous and does not return until replies are obtained or timeouts occurred. This implementation of command_inout allows passing a specific input argument to each device in the group. In order to use this form of command_inout, the user must have an "a priori" and "perfect" knowledge of the devices order in the group.
The parameter c is the name of the command. The std::vector d contains a specific argument value for each device in the group. Since this method is a template, d is able to contain any Tango command argument type. Its size must equal Group::get_size(fwd). Otherwise, an exception is thrown. The order of the argument values must follows the order of the devices in the group (d[0] => 1st device, d[1] => 2nd device and so on). If fwd is set to true (the default), the request is also forwarded to subgroups. Otherwise, it is only applied to the local set of devices. Command results are returned in a GroupCmdReplyList. See Obtaining command results (Chpater 4.7.3.1 in Tango book) for details. See also Case 3 of executing a command (Chapter 4.7.3.5 in Tango book) for an example of this special form of command_inout.
T | The command input data type |
[in] | c | The command name |
[in] | d | The command data |
[in] | fwd | The forward flag |
long Tango::Group::command_inout_asynch | ( | const std::string & | c, |
bool | fgt = false , |
||
bool | fwd = true |
||
) |
Executes a Tango command on each device in the group asynchronously.
Executes a Tango command on each device in the group asynchronously. The method sends the request to all devices and returns immediately. Pass the returned request id to Group::command_inout_reply() to obtain the results. The parameter c is the name of the command. The parameter fgt is a fire and forget flag. If set to true, it means that no reply is expected (i.e. the caller does not care about it and will not even try to get it). A false default value is provided. If the parameter fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. See Case 1 of Executing a command (Chapter 4.7.3.2 in Tango book) for an example.
[in] | c | The command name |
[in] | fgt | The command data |
[in] | fwd | The forward flag |
long Tango::Group::command_inout_asynch | ( | const std::string & | c, |
const DeviceData & | d, | ||
bool | fgt = false , |
||
bool | fwd = true |
||
) |
Executes a Tango command with same input data on each device in the group asynchronously.
Executes a Tango command on each device in the group asynchronously. The method sends the request to all devices and returns immediately. Pass the returned request id to Group::command_inout_reply() to obtain the results. The parameter c is the name of the command. The second parameter d is a Tango generic container for command carrying the command argument. See the Tango::DeviceData documentation for details. The parameter fgt is a fire and forget flag. If set to true, it means that no reply is expected (i.e. the caller does not care about it and will not even try to get it). A false default value is provided. If the parameter fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. See Case 2 of Executing a command (Chapter 4.7.3.4 in Tango book) for an example.
[in] | c | The command name |
[in] | d | The command input data |
[in] | fgt | The command data |
[in] | fwd | The forward flag |
long Tango::Group::command_inout_asynch | ( | const std::string & | c, |
const std::vector< DeviceData > & | d, | ||
bool | fgt = false , |
||
bool | fwd = true |
||
) |
Executes a Tango command with different input data (using DeviceData object) on each device in the group asynchronously.
Executes a Tango command on each device in the group asynchronously. The method send the request to all devices and return immediately. Pass the returned request id to Group::command_inout_reply to obtain the results. This implementation of command_inout allows passing a specific input argument to each device in the group. In order to use this form of command_inout_asynch, the user must have an "a priori" and "perfect" knowledge of the devices order in the group. The parameter c is the name of the command. The std::vector d contains a specific argument value for each device in the group. Its size must equal Group::get_size(fwd). Otherwise, an exception is thrown. The order of the argument values must follows the order of the devices in the group (d[0] => 1st device, d[1] => 2nd device and so on). The parameter fgt is a fire and forget flag. If set to true, it means that no reply is expected (i.e. the caller does not care about it and will not even try to get it). A false default value is provided. If fwd is set to true (the default), the request is also forwarded to subgroups. Otherwise, it is only applied to the local set of devices. See Case 3 of Executing a command (Chapter 4.7.3.5 in Tango book) for an example of this special form of command_inout.
[in] | c | The command name |
[in] | d | The command input data |
[in] | fgt | The command data |
[in] | fwd | The forward flag |
long Tango::Group::command_inout_asynch | ( | const std::string & | c, |
const std::vector< T > & | d, | ||
bool | fgt = false , |
||
bool | fwd = true |
||
) |
Executes a Tango command with different input data on each device in the group asynchronously.
Executes a Tango command on each device in the group asynchronously. The method send the request to all devices and return immediately. Pass the returned request id to Group::command_inout_reply to obtain the results. This implementation of command_inout allows passing a specific input argument to each device in the group. In order to use this form of command_inout_asynch, the user must have an "a priori" and "perfect" knowledge of the devices order in the group. The parameter c is the name of the command. The std::vector d contains a specific argument value for each device in the group. Since it's a template data type, d is able to contain any Tango command argument type. Its size must equal Group::get_size(fwd). Otherwise, an exception is thrown. The order of the argument values must follows the order of the devices in the group (d[0] => 1st device, d[1] => 2nd device and so on). The parameter fgt is a fire and forget flag. If set to true, it means that no reply is expected (i.e. the caller does not care about it and will not even try to get it). A false default value is provided. If fwd is set to true (the default), the request is also forwarded to subgroups. Otherwise, it is only applied to the local set of devices. See Case 3 of Executing a command (Chapter 4.7.3.5 in Tango book) for an example of this special form of command_inout.
T | The command input data type |
[in] | c | The command name |
[in] | d | The command input data |
[in] | fgt | The command data |
[in] | fwd | The forward flag |
GroupCmdReplyList Tango::Group::command_inout_reply | ( | long | req_id, |
long | tmo_ms = 0 |
||
) |
Returns the results of an asynchronous command.
Returns the results of an asynchronous command. The first parameter req_id is a request identifier previously returned by one of the command_inout_asynch methods. For each device in the hierarchy, if the command result is not yet available, command_inout_replywait timeout_ms milliseconds before throwing an exception. This exception will be part of the global reply. If timeout_ms is set to 0, command_inout_reply waits "indefinitely". Command results are returned in a GroupCmdReplyList. See Obtaining command results (Chapter 4.7.3.1 in Tango book) for details.
[in] | req_id | The request identifier |
[in] | tmo_ms | The timeout value |
|
virtual |
Check if the hierarchy contains groups and/or devices which name matches the specified pattern.
Returns true if the hierarchy contains groups and/or devices which name matches the specified pattern. Returns false otherwise. The pattern can be a fully qualified or simple group name, a device name or a device name pattern. If fwd is set to true (the default), the request is also forwarded to subgroups. Otherwise, it is only applied to the local set of elements.
[in] | pattern | The device selection pattern |
[in] | fwd | The forward flag |
|
virtual |
Returns a reference to the specified device.
Returns a reference to the specified device or NULL if there is no device by that name in the group. This method may throw an exception in case the specified device belongs to the group but can’t be reached (not registered, down...). See example below. See also the Tango::DeviceProxy class documentation for details.
The request is systematically forwarded to subgroups (i.e. if no device named device_name could be found in the local set of devices, the request is forwarded to subgroups). Be aware that a group always gets the ownership of its children and deletes them when it is itself deleted. Therefore, never try to delete a DeviceProxy returned by the Group::get_device()method. Use the Tango::Group::remove() method instead.
[in] | device_name | The device name |
|
virtual |
Returns a reference to the "idx-th" device in the hierarchy.
Returns a reference to the "idx-th" device in the hierarchy or NULL if the hierarchy contains less than "idx" devices. This method may throw an exception in case the specified device belongs to the group but can’t be reached (not registered, down...). See previous example. See also the Tango::DeviceProxy class documentation for details. The request is systematically forwarded to subgroups (i.e. if the local set of devices contains less than "idx" devices, the request is forwarded to subgroups). Be aware that a group always gets the ownership of its children and deletes them when it is itself deleted. Therefore, never try to delete a DeviceProxy returned by the Group::get_device()method. Use the Tango::Group::remove() method instead.
[in] | idx | The device name |
std::vector<std::string> Tango::Group::get_device_list | ( | bool | fwd = true | ) |
Returns the list of devices currently in the hierarchy.
Returns the list of devices currently in the hierarchy. If fwd is set to true (the default) the request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. Considering the following hierarchy:
The returned vector content depends on the value of the forward option. If set to true, the results will be organized as follows:
dl[0] contains "my/device/01" which belongs to g1
dl[1] contains "my/device/04" which belongs to g1.g2
dl[2] contains "my/device/05" which belongs to g1.g2
dl[3] contains "my/device/03" which belongs to g1
dl[4] contains "my/device/06" which belongs to g1.g3
dl[5] contains "my/device/08" which belongs to g1.g3.g4
dl[6] contains "my/device/09" which belongs to g1.g3.g4
dl[7] contains "my/device/07" which belongs to g1.g3
dl[8] contains "my/device/02" which belongs to g1
If the forward option is set to false, the results are:
dl[0] contains "my/device/01" which belongs to g1
dl[1] contains "my/device/03" which belongs to g1
dl[2] contains "my/device/02" which belongs to g1
[in] | fwd | The forward flag |
|
virtual |
Returns a reference to the specified group.
Returns a reference to the specified group or NULL if there is no group by that name. The group_name can be a fully qualified name. Considering the following group:
-> gauges | -> cell-01 | | -> penning | | | -> ... | | -> pirani | | | -> ... | -> cell-02 | | -> penning | | | -> ... | | -> pirani | | | -> ... | -> cell-03 | | -> ...
A call to gauges->get_group("penning") returns the first group named "penning" in the hierarchy (i.e. gauges.cell-01.penning)while gauges->get_group("gauges.cell-02.penning”) returns the specified group. The request is systematically forwarded to subgroups (i.e. if no group named group_name could be found in the local set of elements, the request is forwarded to subgroups). Be aware that a group always gets the ownership of its children and deletes them when it is itself deleted. Therefore, never try to delete a Group returned by the Group::get_group() method. Use the Tango::Group::remove() method instead.
[in] | group_name | The group name |
long Tango::Group::get_size | ( | bool | fwd = true | ) |
Return the number of devices in the hierarchy.
Return the number of devices in the hierarchy (respectively the number of device in the group) if the forward option is set to true (respectively set to false)
[in] | fwd | The forward flag |
|
virtual |
Returns a reference to the "idx-th" device in the hierarchy.
Returns a reference to the "idx-th" device in the hierarchy or NULL if the hierarchy contains less than "idx" devices. See the Tango::DeviceProxy class documentation for details. The request is systematically forwarded to subgroups (i.e. if the local set of devices contains less than "idx" devices, the request is forwarded to subgroups). Be aware that a group always gets the ownership of its children and deletes them when it is itself deleted. Therefore, never try to delete a DeviceProxy returned by the Group::get_device()method. Use the Tango::Group::remove() method instead.
[in] | idx | The device name |
|
virtual |
Ping all devices in a group.
Ping all devices in a group. This method returns true if all devices in the group are alive, false otherwise. If fwd is set to true (the default), the request is also forwarded to subgroups. Otherwise, it is only applied to the local set of devices.
[in] | fwd | The forward flag |
GroupAttrReplyList Tango::Group::read_attribute | ( | const std::string & | a, |
bool | fwd = true |
||
) |
Reads an attribute on each device in the group.
Reads an attribute on each device in the group. This method is synchronous and does not return until replies are obtained or timeouts occurred. The parameter a is the name of the attribute to read. If fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. Attribute values are returned in a GroupAttrReplyList. See Obtaining attribute values (Chapter 4.7.4.1 in Tango book) for details. See also Reading an attribute (Chapter 4.7.4 in Tango book) for an example.
[in] | a | The attribute name |
[in] | fwd | The forward flag |
long Tango::Group::read_attribute_asynch | ( | const std::string & | a, |
bool | fwd = true |
||
) |
Reads an attribute on each device in the group asynchronously.
Reads an attribute on each device in the group asynchronously. The method sends the request to all devices and returns immediately. Pass the returned request id to Group::read_attribute_reply() to obtain the results. The parameter a is the name of the attribute to read. If fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. The last parameter (rsv) is reserved for internal purpose and should not be modify. It may disappear in a near future. See Reading an attribute (Chapter 4.7.4 in Tango book) for an example.
[in] | a | The attribute name |
[in] | fwd | The forward flag |
GroupAttrReplyList Tango::Group::read_attribute_reply | ( | long | req_id, |
long | tmo_ms = 0 |
||
) |
Returns the results of an asynchronous attribute reading.
Returns the results of an asynchronous attribute reading. The first parameter req_id is a request identifier previously returned by read_attribute_asynch. For each device in the hierarchy, if the attribute value is not yet available, read_attribute_reply wait timeout_ms milliseconds before throwing an exception. This exception will be part of the global reply. If timeout_ms is set to 0, read_attribute_reply waits "indefinitely". Replies are returned in a GroupAttrReplyList. See Obtaining attribute values (Chapter 4.7.4.1 in Tango book) for details
[in] | req_id | The attribute name list |
[in] | tmo_ms | The timeout value |
GroupAttrReplyList Tango::Group::read_attributes | ( | const std::vector< std::string > & | al, |
bool | fwd = true |
||
) |
Reads several attributes on each device in the group.
Reads several attributes on each device in the group. This method is synchronous and does not return until replies are obtained or timeouts occurred. The parameter al is the list of attributes to be read. If fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. Attribute values are returned in a GroupAttrReplyList. See Obtaining attribute values (Chapter 4.7.4.1 in Tango book) for details. See also Reading an attribute (Chapter 4.7.4 in Tango book) for an example.
[in] | al | The attribute name list |
[in] | fwd | The forward flag |
long Tango::Group::read_attributes_asynch | ( | const std::vector< std::string > & | al, |
bool | fwd = true |
||
) |
Reads several attributes on each device in the group asynchronously.
Reads several attribute on each device in the group asynchronously. The method sends the request to all devices and returns immediately. Pass the returned request id to Group::read_attribute_reply() to obtain the results. The parameter a is the name of the attribute to read. If fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. The last parameter (rsv) is reserved for internal purpose and should not be modify. It may disappear in a near future. See Reading an attribute (Chapter 4.7.4 in Tango book) for an example.
[in] | al | The attribute name list |
[in] | fwd | The forward flag |
GroupAttrReplyList Tango::Group::read_attributes_reply | ( | long | req_id, |
long | tmo_ms = 0 |
||
) |
Returns the results of an asynchronous attributes reading.
Returns the results of an asynchronous attributes reading. The first parameter req_id is a request identifier previously returned by read_attribute_asynch. For each device in the hierarchy, if the attribute value is not yet available, read_attribute_reply wait timeout_ms milliseconds before throwing an exception. This exception will be part of the global reply. If timeout_ms is set to 0, read_attribute_reply waits "indefinitely". Replies are returned in a GroupAttrReplyList. See Obtaining attribute values (Chapter 4.7.4.1 in Tango book) for details
[in] | req_id | The attribute name list |
[in] | tmo_ms | The timeout value |
|
virtual |
Removes any group or device which name matches the specified pattern.
The pattern parameter can be a group name, a device name or a device name pattern (e.g domain_* /family/member_*). Since we can have groups with the same name in the hierarchy, a group name can be fully qualified to specify which group should be removed. Considering the following group:
-> gauges | -> cell-01 | | -> penning | | | -> ... | | -> pirani | | | -> ... | -> cell-02 | | -> penning | | | -> ... | | -> pirani | | | -> ... | -> cell-03 | | -> ...
A call to gauges->remove("penning") will remove any group named "penning" in the hierarchy while gauges->remove("gauges.cell-02.penning") will only remove the specified group. If fwd is set to true (the default), the remove request is also forwarded to subgroups. Otherwise, it is only applied to the local set of elements. For instance, the following code remove any stepper motor in the hierarchy:
[in] | pattern | The device selection pattern |
[in] | fwd | The forward flag |
|
virtual |
Removes any group or device which name matches any of the specified patterns.
The patterns parameter can be an array of group names and/or device names and/or device name patterns. Since we can have groups with the same name in the hierarchy, a group name can be fully qualified to specify which group should be removed. See previous method for details. If fwd is set to true (the default), the remove request is also forwarded to subgroups. Otherwise, it is only applied to the local set of elements.
[in] | patterns | The device selection patterns |
[in] | fwd | The forward flag |
|
virtual |
Removes all elements in the group.
Removes all elements in the group. After such a call, the group is empty.
|
virtual |
Set client side timeout for all devices in the group.
Set client side timeout for all devices composing the group in milliseconds. Any method which takes longer than this time to execute will throw an exception.
[in] | tmo_ms | The timeout value |
GroupReplyList Tango::Group::write_attribute | ( | const DeviceAttribute & | d, |
bool | fwd = true |
||
) |
Writes an attribute on each device in the group.
Writes an attribute on each device in the group. This method is synchronous and does not return until acknowledgements are obtained or timeouts occurred. The first parameter d is a Tango generic container for attribute carrying both the attribute name and the value. See the Tango::DeviceAttribute documentation for details. If fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. Acknowledgements are returned in a GroupReplyList. See Obtaining acknowledgements (Chapter 4.7.5.1 in Tango book) for details. See also Case 1 of Writing an attribute (Chapter 4.7.5.2 in Tango book) for an example.
[in] | d | The attribute name and value |
[in] | fwd | The forward flag |
GroupReplyList Tango::Group::write_attribute | ( | const std::string & | n, |
const std::vector< T > & | d, | ||
bool | fwd = true |
||
) |
Writes one attributes on each device in the group with specific value per device.
Writes an attribute on each device in the group. This method is synchronous and does not return until replies are obtained or timeouts occurred. This implementation of write_attribute allows writing a specific value to each device in the group. In order to use this form of write_attribute, the user must have an "a priori" and "perfect" knowledge of the devices order in the group. The parameter a is the name of the attribute. The std::vector d contains a specific value for each device in the group. Since this method is a template, d is able to contain any Tango attribute type. Its size must equal Group::get_size(fwd). Otherwise, an exception is thrown. The order of the attribute values must follows the order of the devices in the group (d[0] => 1st device, d[1] => 2nd device and so on). If fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. Acknowledgements are returned in a GroupReplyList. See Obtaining acknowledgements (Chapter 4.7.5.1 in Tango book) for details. See also Case 2 of Writing an attribute (Chapter 4.7.5.3 in Tango book) for an example.
T | The attribute data type |
[in] | n | The attribute name |
[in] | d | The attribute names and values |
[in] | fwd | The forward flag |
References write_attribute_reply().
GroupReplyList Tango::Group::write_attribute | ( | const std::vector< DeviceAttribute > & | d, |
bool | fwd = true |
||
) |
Writes several attributes on each device in the group (using DeviceAttribute)
Writes several attributes on each device in the group. This method is synchronous and does not return until acknowledgements are obtained or timeouts occurred. The first parameter d is a vector of Tango generic container for attribute carrying both the attribute name and the value. See the Tango::DeviceAttribute documentation for details. If fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. Acknowledgements are returned in a GroupReplyList. See Obtaining acknowledgements (Chapter 4.7.5.1 in Tango book) for details. See also Case 2 of Writing an attribute (Chapter 4.7.5.3 in Tango book) for an example.
[in] | d | The attribute names and values |
[in] | fwd | The forward flag |
long Tango::Group::write_attribute_asynch | ( | const DeviceAttribute & | d, |
bool | fwd = true |
||
) |
Writes an attribute on each device in the group asynchronously.
Write an attribute on each device in the group asynchronously. The method sends the request to all devices and returns immediately. Pass the returned request id to Group::write_attribute_reply() to obtain the acknowledgements. The first parameter d is a Tango generic container for attribute carrying both the attribute name and the value. See the Tango::DeviceAttribute documentation for details. If fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. See Case 1 of Writing an attribute (Chapter 4.7.5.2 in Tango book) for an example.
[in] | d | The attribute name and value |
[in] | fwd | The forward flag |
long Tango::Group::write_attribute_asynch | ( | const std::string & | a, |
const std::vector< T > & | d, | ||
bool | fwd = true |
||
) |
Writes an attribute on each device in the group asynchronously (Without DeviceAttribute data)
Writes an attribute on each device in the group asynchronously. The method sends the request to all devices and returns immediately. Pass the returned request id to Group::write_attribute_reply() to obtain the acknowledgements. This implementation of write_attribute_asynch allows writing a specific value to each device in the group. In order to use this form of write_attribute_asynch, the user must have an "a priori" and "perfect" knowledge of the devices order in the group. The parameter a is the name of the attribute. The std::vector d contains a specific value for each device in the group. Since this method is a template, d is able to contain any Tango attribute type. Its size must equal Group::get_size(fwd). Otherwise, an exception is thrown. The order of the attribute values must follows the order of the devices in the group (d[0] => 1st device, d[1] => 2nd device and so on). If fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. See Case2 of Writing an attribute (Chapter 4.7.5.3 in Tango book) for an example.
T | The attribute data type |
[in] | a | The attribute name |
[in] | d | The attribute value(s) |
[in] | fwd | The forward flag |
long Tango::Group::write_attribute_asynch | ( | const std::vector< DeviceAttribute > & | d, |
bool | fwd = true |
||
) |
Writes several attributes on each device in the group asynchronously.
Write several attributes on each device in the group asynchronously. The method sends the request to all devices and returns immediately. Pass the returned request id to Group::write_attribute_reply() to obtain the acknowledgements. The first parameter d is a vector of Tango generic container for attribute carrying both the attribute name and the value. See the Tango::DeviceAttribute documentation for details. If fwd is set to true (the default) request is forwarded to subgroups. Otherwise, it is only applied to the local set of devices. See Case 1 of Writing an attribute (Chapter 4.7.5.2 in Tango book) for an example.
[in] | d | The attribute name and value |
[in] | fwd | The forward flag |
GroupReplyList Tango::Group::write_attribute_reply | ( | long | req_id, |
long | tmo_ms = 0 |
||
) |
Returns the acknowledgements of an asynchronous attribute writing.
Returns the acknowledgements of an asynchronous attribute writing. The first parameter req_id is a request identifier previously returned by one of the write_attribute_asynch implementation. For each device in the hierarchy, if the acknowledgement is not yet available, write_attribute_replywait timeout_ms milliseconds before throwing an exception. This exception will be part of the global reply. If timeout_ms is set to 0, write_attribute_reply waits "indefinitely". Acknowledgements are returned in a GroupReplyList. See Obtaining acknowledgements (Chapter 4.7.5.1 in Tango book) for details.
[in] | req_id | The request identifier |
[in] | tmo_ms | The timeout value |
Referenced by write_attribute().