Tango Core Classes Reference  9.3.4
AttributeProxy Class Reference

Easy to use interface to Tango device attribute. More...

#include "tango.h"

Public Member Functions

Constructors
 AttributeProxy (string &name)
 Create a AttributeProxy object. More...
 
 AttributeProxy (const char *name)
 Create a AttributeProxy object. More...
 
Miscellaneous methods
virtual string name ()
 Get attribute name. More...
 
virtual DeviceProxyget_device_proxy ()
 Get associated DeviceProxy instance. More...
 
virtual string status ()
 Get device status. More...
 
virtual DevState state ()
 Get device state. More...
 
virtual int ping ()
 Ping the device. More...
 
Synchronous methods
virtual AttributeInfoEx get_config ()
 Get attribute configuration. More...
 
virtual void set_config (AttributeInfo &ai)
 Set attribute configuration. More...
 
virtual void set_config (AttributeInfoEx &ai)
 Set extended attribute configuration. More...
 
virtual DeviceAttribute read ()
 Read attribute value. More...
 
virtual void write (DeviceAttribute &da)
 Write attribute value. More...
 
virtual DeviceAttribute write_read (DeviceAttribute &da)
 Write the Read attribute value. More...
 
virtual vector< DeviceAttributeHistory > * history (int depth)
 Get attribute history from polling buffer. More...
 
Asynchronous methods
virtual long read_asynch ()
 Read attribute value asynchronously in polling model. More...
 
virtual DeviceAttributeread_reply (long id)
 Get asynchronous read attribute call reply. More...
 
virtual DeviceAttributeread_reply (long id, long to)
 Get asynchronous read attribute call reply with timeout. More...
 
virtual long write_asynch (DeviceAttribute &da)
 Write attribute value asynchrnously in polling model. More...
 
virtual void write_reply (long id)
 Get asynchronous write attribute call reply. More...
 
virtual void write_reply (long id, long to)
 Get asynchronous write attribute call reply with timeout. More...
 
virtual void read_asynch (CallBack &cb)
 Read attribute asynchronously in callback model. More...
 
virtual void write_asynch (DeviceAttribute &da, CallBack &cb)
 Write attribute asynchronously in callback model. More...
 
Polling related methods
virtual bool is_polled ()
 Check if the attribute is polled. More...
 
virtual int get_poll_period ()
 Get attribute polling period. More...
 
virtual void poll (int period)
 Set attribute polling period. More...
 
virtual void stop_poll ()
 Stop attribute polling. More...
 
Event related methods
virtual int subscribe_event (EventType event, CallBack *cb)
 Subscribe to attribute event. More...
 
virtual int subscribe_event (EventType event, CallBack *cb, bool stateless)
 Stateless subscription to attribute event. More...
 
virtual int subscribe_event (EventType event, int event_queue_size, bool stateless=false)
 Stateless subscription to attribute event with event queue. More...
 
virtual void unsubscribe_event (int ev_id)
 Unsubsribe to attribute event. More...
 
virtual void get_events (int event_id, CallBack *cb)
 Get events from event queue (pull model) More...
 
virtual void get_events (int event_id, EventDataList &event_list)
 Get events from event queue (pull model) More...
 
virtual void get_events (int event_id, AttrConfEventDataList &event_list)
 Get events from event queue (pull model) More...
 
virtual int event_queue_size (int event_id)
 Get events number in queue. More...
 
virtual TimeVal get_last_event_date (int event_id)
 Get last event date. More...
 
virtual bool is_event_queue_empty (int event_id)
 Check if the event queue is empty. More...
 

Property related methods

virtual void get_property (string &prop_name, DbData &db)
 Get single attribute property. More...
 
virtual void get_property (vector< string > &prop_names, DbData &db)
 Get multiple attribute property. More...
 
virtual void get_property (DbData &db)
 Get attribute property(ies) More...
 
virtual void put_property (DbData &db)
 Put attribute property(ies) More...
 
virtual void delete_property (string &prop_name)
 Delete a single attribute property. More...
 
virtual void delete_property (vector< string > &prop_names)
 Delete a list of attribute property. More...
 
virtual void delete_property (DbData &db)
 Delete attribute property(ies) More...
 

Detailed Description

Easy to use interface to Tango device attribute.

The high level object which provides the client with an easy-to-use interface to TANGO device attributes. AttributeProxy is a handle to the real attribute (hence the name Proxy) and is not the real attribute (of course). The AttributeProxy manages timeouts, stateless connections (new AttributeProxy() nearly always works), and reconnection if the device server is restarted.

Author
taurel
Revision
1

Constructor & Destructor Documentation

◆ AttributeProxy() [1/2]

AttributeProxy::AttributeProxy ( string &  name)

Create a AttributeProxy object.

Create an AttributeProxy to an attribute of the specified name. The constructor will connect to the TANGO database, query for the device to which the attribute belongs to network address and build a connection to this device. If the device to which the attribute belongs to is defined in the TANGO database but the device server is not running, AttributeProxy will try to build a connection every time the client tries to access the attribute. If an alias name is defined for the attribute, this alias name can be used to create the AttributeProxy instance. If a device name alias is defined for the device, it can be used instead of the three fields device name. If the device to which the attribute belongs to is not defined in the database, an exception is thrown. Examples :

AttributeProxy *my_attr = new AttributeProxy("my/own/device/attr");
AttributeProxy *my_attr_bis = new AttributeProxy("attr_alias");
AttributeProxy *my_attr_ter = new AttributeProxy("dev_alias/attr");
Parameters
[in]nameThe attribute name

◆ AttributeProxy() [2/2]

AttributeProxy::AttributeProxy ( const char *  name)

Create a AttributeProxy object.

Idem previous constructor

Parameters
[in]nameThe attribute name

Member Function Documentation

◆ delete_property() [1/3]

virtual void AttributeProxy::delete_property ( DbData &  db)
virtual

Delete attribute property(ies)

Delete property(ies) for an attribute. Properties to delete are specified using the DbData type. Refer to DbDevice::get_property() and DbData sections for details.

Parameters
[in]dbThe properties name
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database

◆ delete_property() [2/3]

virtual void AttributeProxy::delete_property ( string &  prop_name)
virtual

Delete a single attribute property.

Delete a single property for an attribute. The property to delete is specified as a string. Refer to DbDevice:: delete_property() and DbData sections for details on the DbData type.

Parameters
[in]prop_nameThe property name
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database

◆ delete_property() [3/3]

virtual void AttributeProxy::delete_property ( vector< string > &  prop_names)
virtual

Delete a list of attribute property.

Delete a list of properties for an attribute. The properties to delete are specified as a vector of strings. Refer to DbDevice::get_property() and DbData sections for details on the DbData type.

Parameters
[in]prop_namesThe properties name
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database

◆ event_queue_size()

virtual int AttributeProxy::event_queue_size ( int  event_id)
inlinevirtual

Get events number in queue.

Returns the number of stored events in the event reception buffer. After every call to DeviceProxy:get_events(), the event queue size is 0. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the AttributeProxy::subscribe_event()method.

Parameters
[in]event_idThe event identifier
Returns
The event number in the queue
Exceptions
EventSystemFailed

◆ get_config()

virtual AttributeInfoEx AttributeProxy::get_config ( )
virtual

Get attribute configuration.

Return the attribute configuration

Returns
The attribute configuration data
Exceptions
ConnectionFailed,CommunnicationFailed,DevFailedfrom device

◆ get_device_proxy()

virtual DeviceProxy* AttributeProxy::get_device_proxy ( )
inlinevirtual

Get associated DeviceProxy instance.

Returns the DeviceProxy instance used to communicate with the device to which the attributes belongs

Returns
The underlying DeviceProxy object

◆ get_events() [1/3]

virtual void AttributeProxy::get_events ( int  event_id,
AttrConfEventDataList &  event_list 
)
inlinevirtual

Get events from event queue (pull model)

The method extracts all waiting attribute configuration events from the event reception buffer. The returned event_list is a vector of AttrConfEventData pointers. The AttrConfEventData object contains the event information as for the callback methods. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the AttributeProxy::subscribe_event()method.

Parameters
[in]event_idThe event identifier
[out]event_listThe event list
Exceptions
EventSystemFailed

◆ get_events() [2/3]

virtual void AttributeProxy::get_events ( int  event_id,
CallBack *  cb 
)
inlinevirtual

Get events from event queue (pull model)

The method extracts all waiting events from the event reception buffer and executes the callback method cb for every event. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the AttributeProxy::subscribe_event()method.

Parameters
[in]event_idThe event identifier
[in]cbThe event callback
Exceptions
EventSystemFailed

◆ get_events() [3/3]

virtual void AttributeProxy::get_events ( int  event_id,
EventDataList &  event_list 
)
inlinevirtual

Get events from event queue (pull model)

The method extracts all waiting events from the event reception buffer. The returned event_list is a vector of EventData pointers. The EventData object contains the event information as for the callback methods. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the AttributeProxy::subscribe_event()method.

Parameters
[in]event_idThe event identifier
[out]event_listThe event list
Exceptions
EventSystemFailed

◆ get_last_event_date()

virtual TimeVal AttributeProxy::get_last_event_date ( int  event_id)
inlinevirtual

Get last event date.

Returns the arrival time of the last event stored in the event reception buffer. After every call to AttributeProxy:get_events(), the event reception buffer is empty. In this case an exception will be returned. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the AttributeProxy::subscribe_event()method.

Parameters
[in]event_idThe event identifier
Returns
The last event date
Exceptions
EventSystemFailed

◆ get_poll_period()

virtual int AttributeProxy::get_poll_period ( )
virtual

Get attribute polling period.

Returns the attribute polling period in mS. If the attribute is not polled, it returns 0.

Returns
The polling period

◆ get_property() [1/3]

virtual void AttributeProxy::get_property ( DbData &  db)
virtual

Get attribute property(ies)

Get property(ies) for the attribute. Properties to get are specified using the DbData type. Refer to DbDevice:: get_property() and DbData sections for details.

Parameters
[in,out]dbProperties value
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database

◆ get_property() [2/3]

virtual void AttributeProxy::get_property ( string &  prop_name,
DbData &  db 
)
virtual

Get single attribute property.

Get a single property for the attribute. The property to get is specified as a string. Refer to DbDevice:: get_property() and DbData sections for details on the DbData type.

Parameters
[in]prop_nameThe property name
[out]dbProperty value
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database

◆ get_property() [3/3]

virtual void AttributeProxy::get_property ( vector< string > &  prop_names,
DbData &  db 
)
virtual

Get multiple attribute property.

Get a list of properties for the attribute. The properties to get are specified as a vector of strings. Refer to DbDevice::get_property() and DbData sections for details on the DbData type.

Parameters
[in]prop_namesThe property names
[out]dbProperties value
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database

◆ history()

virtual vector<DeviceAttributeHistory>* AttributeProxy::history ( int  depth)
virtual

Get attribute history from polling buffer.

Retrieve attribute history from the attribute polling buffer. The argument is the wanted history depth. This method returns a vector of DeviceAttributeHistory types. This method allocates memory for the vector of DeviceAttributeHistory returned to the caller. It is the caller responsibility to delete this memory. See Tango book chapter on Advanced Feature for all details regarding polling.

AttributeProxy attr = new AttributeProxy("my/own/device/Current");
vector<DeviceAttributeHistory> *hist;
hist = attr->history(5);
for (int i = 0;i < 5;i++)
{
bool fail = (*hist)[i].has_failed();
if (fail == false)
{
cout << "Attribute name = " << (*hist)[i].get_name() << endl;
cout << "Attribute quality factor = " << (*hist)[i].get_quality() << endl;
long value;
(*hist)[i] >> value;
cout << "Current = " << value << endl;
}
else
{
cout << "Attribute failed !" << endl;
cout << "Error level 0 desc = " << ((*hist)[i].get_err_stack())[0].desc << endl;
}
cout << "Date = " << (*hist)[i].get_date().tv_sec << endl;
}
delete hist;
Parameters
[in]depthThe required history depth
Returns
The attribute value history
Exceptions
ConnectionFailed,CommunnicationFailed,NonSupportedFeature,DevFailedfrom device

◆ is_event_queue_empty()

virtual bool AttributeProxy::is_event_queue_empty ( int  event_id)
inlinevirtual

Check if the event queue is empty.

Returns true when the event reception buffer is empty. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the AttributeProxy::subscribe_event()method.

Parameters
[in]event_idThe event identifier
Returns
The event queue empty flag
Exceptions
EventSystemFailed

◆ is_polled()

virtual bool AttributeProxy::is_polled ( )
virtual

Check if the attribute is polled.

Returns true if the attribute is polled. Otherwise, returns false.

Returns
Boolean true id the attribute is polled

◆ name()

virtual string AttributeProxy::name ( )
inlinevirtual

Get attribute name.

Returns the attribute name

Returns
The attribute name

◆ ping()

virtual int AttributeProxy::ping ( )
virtual

Ping the device.

A method which sends a ping to the device to which the attribute belongs and returns the time elapsed in microseconds. Example :

cout << "device ping took " << my_device->ping() << “ microseconds” << endl;
Returns
Time needed by the ping call
Exceptions
ConnectionFailed,CommunnicationFailed

◆ poll()

virtual void AttributeProxy::poll ( int  period)
virtual

Set attribute polling period.

Add the attribute to the list of polled attributes. The polling period is specified by "period" (in mS). If the attribute is already polled, this method will update the polling period according to "period".

Parameters
[in]periodThe polling period

◆ put_property()

virtual void AttributeProxy::put_property ( DbData &  db)
virtual

Put attribute property(ies)

Put property(ies) for an attribute. Properties to put are specified using the DbData type. Refer to DbDevice:: put_property() and DbData sections for details.

Parameters
[in,out]dbProperties value
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database

◆ read()

virtual DeviceAttribute AttributeProxy::read ( )
virtual

Read attribute value.

Read the attribute. To extract the value you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the attribute native type to user type e.g. if an attribute returns a short you cannot extract it as a double (this will return 0) you have to extract it as a short.

Returns
The attribute value
Exceptions
ConnectionFailed,CommunnicationFailed,DevFailedfrom device

◆ read_asynch() [1/2]

virtual long AttributeProxy::read_asynch ( )
inlinevirtual

Read attribute value asynchronously in polling model.

Read the attribute asynchronously (polling model). This call returns an asynchronous call identifier which is needed to get the attribute value.

Returns
The asynchronous call identifier
Exceptions
ConnectionFailed

◆ read_asynch() [2/2]

virtual void AttributeProxy::read_asynch ( CallBack &  cb)
inlinevirtual

Read attribute asynchronously in callback model.

Read the attribute asynchronously using the callback model. The argument is a reference to a callback object. This callback object should be an instance of a user class inheriting from the Tango::CallBack class with the attr_read() method overloaded.

Parameters
[in]cbThe callback object
Exceptions
ConnectionFailed

◆ read_reply() [1/2]

virtual DeviceAttribute* AttributeProxy::read_reply ( long  id)
inlinevirtual

Get asynchronous read attribute call reply.

Check if the answer of an asynchronous read is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, it is returned to the caller in a DeviceAttribute object. If the reply is an exception, it is re-thrown by this call. An exception is also thrown in case of the reply is not yet arrived. To extract attribute value, you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the attribute native type to user type e.g. if an attribute returns a short you cannot extract it as a double, you have to extract it as a short. Memory has been allocated for the DeviceAttribute object returned to the caller. This is the caller responsibility to delete this memory.

Parameters
[in]idThe asynchronous identifier
Returns
The attribute value
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ read_reply() [2/2]

virtual DeviceAttribute* AttributeProxy::read_reply ( long  id,
long  to 
)
inlinevirtual

Get asynchronous read attribute call reply with timeout.

Check if the answer of an asynchronous read is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, it is returned to the caller in a DeviceAttribute object. If the reply is an exception, it is re-thrown by this call. If the reply is not yet arrived, the call will wait (blocking the process) for the time specified in timeout. If after timeout milliseconds, the reply is still not there, an exception is thrown. If timeout is set to 0, the call waits until the reply arrived. To extract attribute value, you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the attribute native type to user type e.g. if an attribute returns a short you cannot extract it as a double, you have to extract it as a short. Memory has been allocated for the DeviceAttribute object returned to the caller. This is the caller responsibility to delete this memory.

Parameters
[in]idThe asynchronous identifier
[in]toThe timeout value
Returns
The attribute value
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ set_config() [1/2]

virtual void AttributeProxy::set_config ( AttributeInfo &  ai)
virtual

Set attribute configuration.

Change the attribute configuration.

Parameters
[in]aiThe new attribute configuration data
Exceptions
ConnectionFailed,CommunnicationFailed,DevFailedfrom device
Deprecated:
Use the set_config() method with AttributeInfoEx parameter data type

◆ set_config() [2/2]

virtual void AttributeProxy::set_config ( AttributeInfoEx &  ai)
virtual

Set extended attribute configuration.

Change the attribute configuration.

Parameters
[in]aiThe new extended attribute configuration data
Exceptions
ConnectionFailed,CommunnicationFailed,DevFailedfrom device

◆ state()

virtual DevState AttributeProxy::state ( )
virtual

Get device state.

A method which returns the state of the device to which the attribute belongs to. This state is returned as a Tango::DevState type. Example :

dev_state = my_attr->state() << endl;
Returns
The underlying device state
Exceptions
ConnectionFailed,CommunnicationFailed

◆ status()

virtual string AttributeProxy::status ( )
virtual

Get device status.

A method which return the status of the device to which the attribute belongs to. The status is returned as a string. Example :

cout << "device status: " << my_attr->status() << endl;
Returns
The underlying device status
Exceptions
ConnectionFailed,CommunnicationFailed

◆ stop_poll()

virtual void AttributeProxy::stop_poll ( )
virtual

Stop attribute polling.

Remove attribute from the list of polled attributes.

◆ subscribe_event() [1/3]

virtual int AttributeProxy::subscribe_event ( EventType  event,
CallBack *  cb 
)
virtual

Subscribe to attribute event.

The client call to subscribe for event reception in the pushmodel. The client implements a callbackmethod which is triggered when the event is received either by polling or a dedicated thread. Filtering is done based on the reason specified and the event type. For example when reading the state and the reason specified is "change" the event will be fired only when the state changes. Events consist of an attribute name and the event reason. A standard set of reasons are implemented by the system, additional device specific reasons an be implemented by device servers programmers. cb is a pointer to a class inheriting fromthe Tango CallBack class and implementing a push_event() method. The lifetime of the pointed to object must at least be equal to the time when events are requested because only the pointer is stored into the event machinery. The subscribe_event() call returns an event id which has to be specified when unsubscribing from this event.

Parameters
[in]eventThe event type (reason)
[in]cbThe event callback
Returns
The event identifier
Exceptions
EventSystemFailed

◆ subscribe_event() [2/3]

virtual int AttributeProxy::subscribe_event ( EventType  event,
CallBack *  cb,
bool  stateless 
)
virtual

Stateless subscription to attribute event.

This subscribe event method has the same functionality as described in the last section. It adds an additional flag called stateless. When the stateless flag is set to false, an exception will be thrown when the event subscription encounters a problem. With the stateless flag set to true, the event subscription will always succeed, even if the corresponding device server is not running. The keep alive thread will try every 10 seconds to subscribe for the specified event. At every subscription retry, a callback is executed which contains the corresponding exception.

Parameters
[in]eventThe event type (reason)
[in]cbThe event callback
[in]statelessThe stateless flag
Returns
The event identifier
Exceptions
EventSystemFailed

◆ subscribe_event() [3/3]

virtual int AttributeProxy::subscribe_event ( EventType  event,
int  event_queue_size,
bool  stateless = false 
)
virtual

Stateless subscription to attribute event with event queue.

The client call to subscribe for event reception in the pull model. Instead of a callback method the client has to specify the size of the event reception buffer. The event reception buffer is implemented as a round robin buffer. This way the client can set-up different ways to receive events.

  • Event reception buffer size = 1 : The client is interested only in the value of the last event received. All other events that have been received since the last reading are discarded.
  • Event reception buffer size > 1 : The client has chosen to keep an event history of a given size. When more events arrive since the last reading, older events will be discarded.
  • Event reception buffer size = ALL_EVENTS : The client buffers all received events. The buffer size is unlimited and only restricted by the available memory for the client.

All other parameters are similar to the descriptions given in the last two sections.

Parameters
[in]eventThe event type (reason)
[in]event_queue_sizeThe event queue size
[in]statelessThe stateless flag
Returns
The event identifier
Exceptions
EventSystemFailed

◆ unsubscribe_event()

virtual void AttributeProxy::unsubscribe_event ( int  ev_id)
inlinevirtual

Unsubsribe to attribute event.

Unsubscribe a client from receiving the event specified by event_id. event_id is the event identifier returned by the AttributeProxy::subscribe_event() method.

Parameters
[in]ev_idThe event identifier
Exceptions
EventSystemFailed

◆ write()

virtual void AttributeProxy::write ( DeviceAttribute da)
virtual

Write attribute value.

Write the attribute. To insert the value to write you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the user type to the attribute native type e.g. if an attribute expects a short you cannot insert it as a double (this will throw an exception) you have to insert it as a short.

Parameters
[in]daThe new attribute value
Exceptions
ConnectionFailed,CommunnicationFailed,DevUnlocked,DevFailedfrom device

◆ write_asynch() [1/2]

virtual long AttributeProxy::write_asynch ( DeviceAttribute da)
inlinevirtual

Write attribute value asynchrnously in polling model.

Write the attribute asynchronously (polling model). To insert the value to write you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the user type to the attribute native type e.g. if an attribute expects a short you cannot insert it as a double (this will throw an exception) you have to insert it as a short. This call returns an asynchronous call identifier which is needed to get the server reply.

Parameters
[in]daThe attribute value
Returns
The asynchrnous call identifier
Exceptions
ConnectionFailed

◆ write_asynch() [2/2]

virtual void AttributeProxy::write_asynch ( DeviceAttribute da,
CallBack &  cb 
)
inlinevirtual

Write attribute asynchronously in callback model.

Write the attribute asynchronously using the callback model. The argument is a reference to a callback object. This callback object should be an instance of a user class inheriting from the Tango::CallBack class with the attr_written() method overloaded.

Parameters
[in]daThe new attribute value
[in]cbThe callback object
Exceptions
ConnectionFailed

◆ write_read()

virtual DeviceAttribute AttributeProxy::write_read ( DeviceAttribute da)
virtual

Write the Read attribute value.

Write then read a single attribute in a single network call. By default (serialisation by device), the execution of this call in the server can’t be interrupted by other clients. To insert/extract the value to write/read you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the user type to the attribute native type e.g. if an attribute expects a short you cannot insert it as a double (this will throw an exception) you have to insert it as a short.

Parameters
[in]daThe new attribute value
Returns
The new attribute value
Exceptions
ConnectionFailed,CommunnicationFailed,DevUnlocked,DevFailedfrom device

◆ write_reply() [1/2]

virtual void AttributeProxy::write_reply ( long  id)
inlinevirtual

Get asynchronous write attribute call reply.

Check if the answer of an asynchronous write is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, the call returned. If the reply is an exception, it is re-thrown by this call. An exception is also thrown in case of the reply is not yet arrived.

Parameters
[in]idThe asynchronous identifier
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ write_reply() [2/2]

virtual void AttributeProxy::write_reply ( long  id,
long  to 
)
inlinevirtual

Get asynchronous write attribute call reply with timeout.

Check if the answer of an asynchronous write is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, the call returned. If the reply is an exception, it is re-thrown by this call. If the reply is not yet arrived, the call will wait (blocking the process) for the time specified in timeout. If after timeout milliseconds, the reply is still not there, an exception is thrown. If timeout is set to 0, the call waits until the reply arrived.

Parameters
[in]idThe asynchronous identifier
[in]toThe timeout value
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

The documentation for this class was generated from the following file:
AttributeProxy
Easy to use interface to Tango device attribute.
Definition: AttributeProxy.h:58
AttributeProxy::history
virtual vector< DeviceAttributeHistory > * history(int depth)
Get attribute history from polling buffer.
AttributeProxy::state
virtual DevState state()
Get device state.
AttributeProxy::AttributeProxy
AttributeProxy(string &name)
Create a AttributeProxy object.
AttributeProxy::status
virtual string status()
Get device status.