RTI Connext Modern C++ API  Version 6.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rti::core::cond::AsyncWaitSetCompletionToken Class Reference

<<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>

Inheritance diagram for rti::core::cond::AsyncWaitSetCompletionToken:
dds::core::Reference< AsyncWaitSetCompletionTokenImpl >

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.
 

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.
 

Detailed Description

<<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:

AsyncWaitSetCompletionToken management

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.

MT Safety:
Safe.
See Also
rti::core::cond::AsyncWaitSet

Constructor & Destructor Documentation

rti::core::cond::AsyncWaitSetCompletionToken::AsyncWaitSetCompletionToken ( AsyncWaitSet aws)
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.

Returns
A new rti::core::cond::AsyncWaitSetCompletionToken or NULL on error.
See Also
rti::core::cond::AsyncWaitSet::delete_completion_token
rti::core::cond::AsyncWaitSet::delete

Member Function Documentation

void rti::core::cond::AsyncWaitSetCompletionToken::wait ( const dds::core::Duration max_wait = dds::core::Duration::infinite())
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.

Parameters
max_wait<<in>> Cannot be NULL. Maximum time to wait for the request associated to this completion token to complete before timeout.
Exceptions
Oneof the Standard Exceptions
See Also
rti::core::cond::AsyncWaitSet

RTI Connext Modern C++ API Version 6.0.1 Copyright © Sat Nov 23 2019 Real-Time Innovations, Inc