Pin
Public Member Functions | Public Attributes | List of all members

Public Member Functions

VOID Set (const T &value)
 
VOID Set (const T *pValue)
 
VOID Reset ()
 
BOOL Get (T *pValue) const
 
BOOL HasValue () const
 
T & Value ()
 
const T & Value () const
 
T * ValuePtr ()
 
const T * ValuePtr () const
 

Public Attributes

BOOL m_hasValue
 
m_value
 

Detailed Description

template<typename T>
struct OPTIONAL_VALUE< T >

Template POD structure that optionally keeps a value of type <T>.

Template Parameters
Tthe value type

Member Function Documentation

◆ Get()

template<typename T >
BOOL OPTIONAL_VALUE< T >::Get ( T *  pValue) const
inline

Get the value of this object, if previously assigned.

Parameters
[out]pValueoptional pointer to variable that receives the value assigned to this object, if any
Returns
TRUE if a value has been assigned to this object.

◆ HasValue()

template<typename T >
BOOL OPTIONAL_VALUE< T >::HasValue ( ) const
inline
Returns
TRUE if a value has been assigned to this object.

◆ Reset()

template<typename T >
VOID OPTIONAL_VALUE< T >::Reset ( )
inline

Remove the previous value assignment, if any.

◆ Set() [1/2]

template<typename T >
VOID OPTIONAL_VALUE< T >::Set ( const T &  value)
inline

Assign the specified value to this object.

Parameters
[in]valuethe new value to be assigned to this object

◆ Set() [2/2]

template<typename T >
VOID OPTIONAL_VALUE< T >::Set ( const T *  pValue)
inline

Assign a value to this object or remove the previous assignment.

Parameters
[in]pValuepointer to the new value to be assigned to this object or NULL to remove the previous assignment

◆ Value()

template<typename T >
T& OPTIONAL_VALUE< T >::Value ( )
inline
Returns
reference to the value assigned to this object. The caller must ensure that a value has already been assigned to this object.

◆ ValuePtr()

template<typename T >
T* OPTIONAL_VALUE< T >::ValuePtr ( )
inline

Get a pointer to the value of this object, if the value has been assigned.

Returns
pointer to the value kept in this object or NULL if no value has been assigned to this object.

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