Cyclone ISO C++ API Reference Guide
|
#include "Optional.hpp"
Inherits dds::core::Value< D >.
Public Member Functions | |
optional (const T &t) | |
T & | get () |
const T & | get () const |
bool | is_set () const |
bool | operator!= (const Value &other) const |
D * | operator-> () |
const D * | operator-> () const |
bool | operator== (const Value &other) const |
void | reset () |
The optional class is used to wrap attributes annotated in the idl with the @optional annotation. This class provides a simple and safe way of accessing, setting and resetting the stored attribute.
IDL:
C++ Representation:
Definition at line 69 of file Optional.hpp.
dds::core::optional< T >::optional | ( | const T & | t | ) |
T& dds::core::optional< T >::get | ( | ) |
Get the attribute. An exception is thrown if the attribute is not set.
const T& dds::core::optional< T >::get | ( | ) | const |
Get the attribute. An exception is thrown if the attribute is not set.
bool dds::core::optional< T >::is_set | ( | ) | const |
Returns true only if the attribute is set.
|
inherited |
|
inherited |
The operator->() is provided to be able to directly invoke functions on the delegate.
The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Value and on all its subclasses as follows:
|
inherited |
The operator->() is provided to be able to directly invoke functions on the delegate.
The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Value and on all its subclasses as follows:
|
inherited |
void dds::core::optional< T >::reset | ( | ) |
Reset the attribute.