CoreDX DDS Modern C++ API
Public Member Functions | List of all members
dds::core::optional< T, DELEGATE > Class Template Reference

The optional class is used to wrap attributes annotated with the annotation. More...

Inheritance diagram for dds::core::optional< T, DELEGATE >:
Inheritance graph
[legend]
Collaboration diagram for dds::core::optional< T, DELEGATE >:
Collaboration graph
[legend]

Public Member Functions

bool is_set () const
 Returns true only if the attribute is set.
 
void reset ()
 Reset the attribute.
 
const T & get () const
 Get the attribute. More...
 
T & get ()
 Get the attribute. More...
 
- Public Member Functions inherited from dds::core::Value< DELEGATE< T > >
const DELEGATE< T > * operator-> () const
 Return the delegate.
 
DELEGATE< T > * operator-> ()
 Return the delegate.
 
const DELEGATE< T > & delegate () const
 Return the delegate.
 
DELEGATE< T > & delegate ()
 Return the delegate.
 

Detailed Description

template<typename T, template< typename Q > class DELEGATE>
class dds::core::optional< T, DELEGATE >

The optional class is used to wrap attributes annotated with the annotation.

This class provides a simple and safe way of accessing, setting and resetting the stored attribute.

Member Function Documentation

◆ get() [1/2]

template<typename T , template< typename Q > class DELEGATE>
const T& dds::core::optional< T, DELEGATE >::get ( ) const

Get the attribute.

An exception is thrown if the attribute is not set.

◆ get() [2/2]

template<typename T , template< typename Q > class DELEGATE>
T& dds::core::optional< T, DELEGATE >::get ( )

Get the attribute.

An exception is thrown if the attribute is not set.


© 2009-2020 Twin Oaks Computing, Inc
Castle Rock, CO 80104
All rights reserved.