RTI Connext Modern C++ API
Version 5.3.1
|
<<interface>> Implementation of the completion token role element of the asynchronous completion token pattern that is part of the rti::core::cond::AsyncWaitSet behavior. More...
#include <AsyncWaitSet.hpp>
Inherits dds::core::Reference< DELEGATE >.
Public Member Functions | |
AsyncWaitSetCompletionToken (AsyncWaitSet &aws) | |
Creates a new rti::core::cond::AsyncWaitSetCompletionToken. | |
void | wait (const dds::core::Duration &max_wait=dds::core::Duration::infinite()) |
Waits for the request associated to an operation made on the rti::core::cond::AsyncWaitSet to complete. | |
DDS_AsyncWaitSetCompletionToken * | native_completion_token () |
Internal use only. | |
![]() | |
Reference (dds::core::null_type &) | |
Reference (const Reference &ref) | |
template<typename D > | |
Reference (const Reference< D > &ref) | |
~Reference () | |
template<typename R > | |
bool | operator== (const R &ref) const |
template<typename R > | |
bool | operator!= (const R &ref) const |
Reference & | operator= (const null_type) |
bool | is_nil () const |
bool | operator== (const null_type) const |
bool | operator!= (const null_type) const |
const DELEGATE_REF_T & | delegate () const OMG_NOEXCEPT |
DELEGATE_REF_T & | delegate () OMG_NOEXCEPT |
DELEGATE * | operator-> () OMG_NOEXCEPT |
const DELEGATE * | operator-> () const OMG_NOEXCEPT |
Static Public Member Functions | |
static AsyncWaitSetCompletionToken | Ignore () |
For the operations that allow an rti::core::cond::AsyncWaitSetCompletionToken, this sentinel can be provided to indicate an rti::core::cond::AsyncWaitSet to perform the action associating a 'null' completion token. | |
<<interface>> Implementation of the completion token role element of the asynchronous completion token pattern that is part of the rti::core::cond::AsyncWaitSet behavior.
A rti::core::cond::AsyncWaitSetCompletionToken can be in one of the following states:
READY:
The completion token can be used to associate a new request. Calling rti::core::cond::AsyncWaitSetCompletionToken::wait on a ready completion token will return immediately with success. A ready completion token can only transition to the queued state. QUEUED:
The completion token has an associated request that is pending processing. Calling rti::core::cond::AsyncWaitSetCompletionToken::wait on a queued completion token will block until the request completes or times out. A queued completion token can only transition to the processed state. PROCESS:
The completion token has an associated request that has been processed but the application did not call rti::core::cond::AsyncWaitSetCompletionToken::wait yet. Calling rti::core::cond::AsyncWaitSetCompletionToken::wait on a processed completion token will return immediately with the return code result of processing the associated request. A processed completion token can transition to both ready or queued states. The same rti::core::cond::AsyncWaitSetCompletionToken instance can be reused reused multiple times to associate a request and wait for its completion. Reusing is allowed only if the completion token is either in READY
or PROCESSED
state. Otherwise the rti::core::cond::AsyncWaitSet operation that associates the completion token will fail with dds::core::PreconditionNotMetError.
The completion token functionality can be viewed as a rti::core::cond::AsyncWaitSet internal detail from which your application should not need to know. In general, it is recommended to use the default flavor of rti::core::cond::AsyncWaitSet operations that handle the internals of the completion tokens for you.
Nevertheless, if a completion token represents an expensive resource in your environment, your application may want to have full control of how and when completion tokens are created. It's for these reasons why is exposed as a public collaborator of the rti::core::cond::AsyncWaitSet.
|
inline |
Creates a new rti::core::cond::AsyncWaitSetCompletionToken.
All the created rti::core::cond::AsyncWaitSetCompletionToken must be deleted by calling rti::core::cond::AsyncWaitSet::delete_completion_token.
|
inline |
Waits for the request associated to an operation made on the rti::core::cond::AsyncWaitSet to complete.
This operation will block the calling thread for a maximum amount of time specified by max_wait
until the rti::core::cond::AsyncWaitSet request associated with this completion token completes.
If there is no timeout, upon return it is guaranteed that the request associated with this token completed. This operation may fail due to an error during the wait or while processing the associated request.
If this operation is called from within the context of one the thread that conforms the thread poolof the rti::core::cond::AsyncWaitSet, it will fail with dds::core::PreconditionNotMetError.
If the operation failed with dds::core::TimeoutError your application can wait again on this completion token.
max_wait | <<in>> Cannot be NULL. Maximum time to wait for the request associated to this completion token to complete before timeout. |
One | of the Standard Exceptions |
|
inline |
Internal use only.