CXXR (C++ R) API
Public Types | Static Public Member Functions
CXXR::ElementTraits::Data< T > Struct Template Reference

Information about the data payload. More...

#include <ElementTraits.hpp>

List of all members.

Public Types

typedef T type
 Type of the data payload held in this element type.

Static Public Member Functions

static const typeget (const T &t)
 Access the data payload.

Detailed Description

template<typename T>
struct CXXR::ElementTraits::Data< T >

Information about the data payload.

In some element types, including all the standard R atomic data types, the 'value' of a vector element is held directly in a data item of the element type T , and in that case a special value within the range of type T may be used to signify that an item of data is 'not available'.

However, CXXR also allows the possibility that a vector element type T can be a class type whose objects contain a value of some underlying type, representing the data 'payload', along with a separate flag (typically a bool) indicating whether or not the data is 'not available'.

This class provides facilities to allow generic programs to handle both these cases straightforwardly. As defined here, the class deals with the first case described above; specializations of the Data template can be used to address the second case.

Template Parameters:
TA type capable of being used as the element type of an R data vector.

Member Function Documentation

template<typename T>
static const type& CXXR::ElementTraits::Data< T >::get ( const T &  t)
inlinestatic

Access the data payload.

Parameters:
tReference to an object of the element type.
Returns:
reference to the data payload contained within t .

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