iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::OptionalBase< T, true > Class Template Reference

#include <nrt/Core/Design/details/OptionalHelpers.H>

template<class T>
class nrt::OptionalBase< T, true >

Reference template specialization for OptionalBase.

Template Parameters
TThe type to hold, stripped of any reference

Definition at line 104 of file OptionalHelpers.H.

Public Types

typedef
std::add_lvalue_reference< T >
::type 
ActualType
 The actual type we hold.
 
typedef
std::add_lvalue_reference< T >
::type 
ArgumentTypeCopy
 The type we expect for copy construction.
 
typedef
std::add_rvalue_reference< T >
::type 
ArgumentTypeMove
 The type we expect for move construction.
 

Public Member Functions

 OptionalBase ()
 Default construction.
 
 OptionalBase (OptionalBase const &other)
 Copy construction.
 
 OptionalBase (OptionalBase &&other)
 Move construction. More...
 
 OptionalBase (ActualType otherT)
 Construct from some existing T.
 
 OptionalBase (T &&otherT)=delete
 Cannot construct a reference to a temporary.
 
 ~OptionalBase ()
 Destructor.
 
OptionalBaseoperator= (OptionalBase const &other)
 Copy assignment.
 
OptionalBaseoperator= (OptionalBase &&other)
 Move assignment. More...
 
OptionalBaseoperator= (ActualType otherT)
 Copy assignment from a reference.
 
OptionalBaseoperator= (T &&otherT)=delete
 Cannot have temporary references.
 
ActualType inferType ()
 Used with decltype to infer our type, not callable as a function.
 
ActualType const inferType () const
 Used with decltype to infer our type, not callable as a function.
 
void clear ()
 Resets our content so we don't have anything.
 
bool isSet () const
 Checks if we have content.
 
 operator bool () const
 Converts to bool, giving the value of isSet()
 
T * get ()
 Gets our value if it exists, otherwise returns nullptr.
 
T const * get () const
 Gets our value if it exists, otherwise returns nullptr.
 
T * operator-> ()
 Gets our value if it exists, otherwise returns nullptr.
 
T const * operator-> () const
 Gets our value if it exists, otherwise returns nullptr.
 
T & operator* ()
 Gets our value if it exists, otherwise a runtime error will occur.
 
T const & operator* () const
 Gets our value if it exists, otherwise a runtime error will occur.
 

Constructor & Destructor Documentation

template<class T >
nrt::OptionalBase< T, true >::OptionalBase ( OptionalBase< T, true > &&  other)

Move construction.

Move construction will invalidate the other OptionalBase

Member Function Documentation

template<class T >
OptionalBase& nrt::OptionalBase< T, true >::operator= ( OptionalBase< T, true > &&  other)

Move assignment.

Move assignment will invalidate the other OptionalBase


The documentation for this class was generated from the following file: