|
Robot Raconteur Core C++ Library
|
Subscription for sub objects of the default client. More...
#include <Subscription.h>
Public Member Functions | |
| template<typename T> | |
| boost::shared_ptr< T > | GetDefaultClient () |
| Get the "default client" sub object. | |
| template<typename T> | |
| bool | TryGetDefaultClient (boost::shared_ptr< T > &client_out) |
| Try getting the "default client" sub object. | |
| template<typename T> | |
| boost::shared_ptr< T > | GetDefaultClientWait (int32_t timeout=RR_TIMEOUT_INFINITE) |
| Get the "default client" sub object, waiting for a specified timeout. | |
| template<typename T> | |
| bool | TryGetDefaultClientWait (boost::shared_ptr< T > &client_out, int32_t timeout=RR_TIMEOUT_INFINITE) |
| Try getting the "default client" sub object, waiting for a specified timeout. | |
| template<typename T> | |
| void | AsyncGetDefaultClient (boost::function< void(const boost::shared_ptr< T > &, const boost::shared_ptr< RobotRaconteurException > &)> handler, int32_t timeout=RR_TIMEOUT_INFINITE) |
| Asynchronously get the "default client" sub object. | |
| void | Close () |
| Closes the sub object subscription. | |
Subscription for sub objects of the default client.
SubObjectSubscription is used to access sub objects of the default client. Sub objects are objects within a service that are not the root object. Sub objects are typically referenced using objref members, however they can also be referenced using a service path. The SubObjectSubscription class is used to automatically access sub objects of the default client.
Use ServiceSubscription::SubscribeSubObject() to create a SubObjectSubscription.
This class should not be used to access Pipe or Wire members. Use the ServiceSubscription::SubscribePipe() and ServiceSubscription::SubscribeWire() functions to access Pipe and Wire members.
|
inline |
Asynchronously get the "default client" sub object.
Asynchronous version of GetDefaultClient()
The handler function is called when the client is retrieved or an error occurs.
| T | The type of the sub object |
| handler | The handler function |
| timeout | The timeout in milliseconds |
| void RobotRaconteur::SubObjectSubscription::Close | ( | ) |
Closes the sub object subscription.
Sub object subscriptions are automatically closed when the parent ServiceSubscription is closed or when the node is shut down.
|
inline |
Get the "default client" sub object.
The sub object is retrieved from the default client. The default client is the first client that connected to the service. If no clients are currently connected, an exception is thrown.
Clients using GetDefaultClient() should not store a reference to the client. Call GetDefaultClient() each time the client is needed.
| T | The type of the sub object |
|
inline |
Get the "default client" sub object, waiting for a specified timeout.
The sub object is retrieved from the default client. The default client is the first client that connected to the service. If no clients are currently connected, an exception is thrown.
Clients using GetDefaultClient() should not store a reference to the client. Call GetDefaultClient() each time the client is needed.
This function blocks the current thread until the client is retrieved or the timeout is reached.
| T | The type of the sub object |
| timeout | The timeout in milliseconds |
|
inline |
Try getting the "default client" sub object.
Same as GetDefaultClient(), but returns a bool for success or failure instead of throwing an exception on failure.
| T | The type of the sub object |
| client_out | [out] The sub object |
|
inline |
Try getting the "default client" sub object, waiting for a specified timeout.
Same as GetDefaultClientWait(), but returns a bool for success or failure instead of throwing an exception on failure.
| T | The type of the sub object |
| client_out | [out] The sub object |
| timeout | The timeout in milliseconds |