|
Robot Raconteur Core C++ Library
|
Helper class for synchronous service generators. More...
#include <Generator.h>
Public Member Functions | |
| RR_OVIRTUAL Return | Next () RR_OVERRIDE=0 |
| Advance the generator. | |
| RR_OVIRTUAL void | AsyncNext (boost::function< void(const Return &, const boost::shared_ptr< RobotRaconteurException > &err)> handler, int32_t timeout=RR_TIMEOUT_INFINITE) RR_OVERRIDE |
| Asynchronously advance the generator. | |
| RR_OVIRTUAL void | Abort () RR_OVERRIDE=0 |
| Abort the generator. | |
| RR_OVIRTUAL void | AsyncAbort (boost::function< void(const boost::shared_ptr< RobotRaconteurException > &)> handler, int32_t timeout=RR_TIMEOUT_INFINITE) RR_OVERRIDE |
| Asynchronously abort the generator. | |
| RR_OVIRTUAL void | Close () RR_OVERRIDE=0 |
| Close the generator. | |
| RR_OVIRTUAL void | AsyncClose (boost::function< void(const boost::shared_ptr< RobotRaconteurException > &)> handler, int32_t timeout=RR_TIMEOUT_INFINITE) RR_OVERRIDE |
| Asynchronously closes the generator. | |
| virtual bool | TryNext (const void &v, Return &ret) |
| Try to advance the generator. Return false if no more values are available. | |
| virtual void | AsyncAbort (boost::function< void(const boost::shared_ptr< RobotRaconteurException > &err)> handler, int32_t timeout=RR_TIMEOUT_INFINITE)=0 |
| Asynchronously abort the generator. | |
| virtual void | AsyncClose (boost::function< void(const boost::shared_ptr< RobotRaconteurException > &err)> handler, int32_t timeout=RR_TIMEOUT_INFINITE)=0 |
| Asynchronously closes the generator. | |
| virtual bool | TryNext (Return &ret) |
| Try to advance the generator. Return false if no more values are available. | |
| virtual std::vector< Return > | NextAll () |
| Automatically call Next() repeatedly and return std::vector of results. | |
Helper class for synchronous service generators.
By default, services will call AsyncNext(), AsyncClose(), and AsyncAbort(). This class will redirect these calls to synchronous Next(), Close, and Abort(). Inherit from SyncGenerator for this behavior.
|
pure virtual |
Abort the generator.
Aborts and destroys the generator. This is assumed to be an error condition. Next() should throw OperationAbortedException if called after Abort(). Any ongoing operations should be terminated with an error condition, for example a moving robot should be immediately halted.
Implements RobotRaconteur::Generator< Return, void >.
|
inline |
Asynchronously abort the generator.
Same as Abort() but returns asynchronously.
| handler | The handler to call when abort is complete |
| timeout | Timeout in milliseconds, or RR_TIMEOUT_INFINITE for no timeout. |
|
pure virtual |
Asynchronously abort the generator.
Same as Abort() but returns asynchronously.
| handler | The handler to call when abort is complete |
| timeout | Timeout in milliseconds, or RR_TIMEOUT_INFINITE for no timeout. |
|
inline |
Asynchronously closes the generator.
Same as Close() but returns asynchronously.
| handler | The handler to call when close is complete |
| timeout | Timeout in milliseconds, or RR_TIMEOUT_INFINITE for no timeout. |
|
pure virtual |
Asynchronously closes the generator.
Same as Close() but returns asynchronously.
| handler | The handler to call when close is complete |
| timeout | Timeout in milliseconds, or RR_TIMEOUT_INFINITE for no timeout. |
|
inlinevirtual |
Asynchronously advance the generator.
Same as Next() but returns asynchronously.
| v | Parameter to pass to generator |
| handler | A handler function to receive the return value or an exception |
| timeout | Timeout in milliseconds, or RR_TIMEOUT_INFINITE for no timeout. |
Implements RobotRaconteur::Generator< Return, void >.
|
pure virtual |
Close the generator.
Closes the generator. Closing the generator terminates iteration and destroys the generator. This operation cleanly closes the generator, and is not considered to be an error condition. Next() should throw StopIterationException if called after Close().
Implements RobotRaconteur::Generator< Return, void >.
|
pure virtual |
Advance the generator.
Next() advances the generator to retrieve the next value. This version of Generator does not include passing a parameter to the generator.
Implements RobotRaconteur::Generator< Return, void >.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Try to advance the generator. Return false if no more values are available.
TryNext() is similar to Next() but returns false if no more values are available. This version of TryNext() does not include passing a parameter to the generator.
| ret | Return value from generator |
|
inlinevirtual |
Try to advance the generator. Return false if no more values are available.
TryNext() is similar to Next() but returns false if no more values are available. This is useful for generators that may not have a fixed number of values.
| v | Parameter to pass to generator |
| ret | Return value from generator |