Rcpp Version 0.12.12
Rcpp::Nullable< T > Class Template Reference

#include <Nullable.h>

Public Member Functions

 Nullable ()
 
 Nullable (const T &t)
 
 Nullable (SEXP t)
 
Nullableoperator= (SEXP sexp)
 
 operator SEXP () const
 
SEXP get () const
 
bool isUsable () const
 
bool isNull () const
 
bool isNotNull () const
 
bool isSet (void) const
 
as ()
 
clone () const
 

Private Member Functions

void checkIfSet (void) const
 

Private Attributes

SEXP m_sexp
 
bool m_set
 

Detailed Description

template<class T>
class Rcpp::Nullable< T >

Definition at line 33 of file Nullable.h.

Constructor & Destructor Documentation

template<class T >
Rcpp::Nullable< T >::Nullable ( )
inline

Empty no-argument constructor of a Nullable object

Assigns (R's) NULL value, and sets validator to FALSE

Definition at line 41 of file Nullable.h.

template<class T >
Rcpp::Nullable< T >::Nullable ( const T &  t)
inline

Template constructor of a Nullable object

Assigns object, and set validator to TRUE

Definition at line 49 of file Nullable.h.

template<class T >
Rcpp::Nullable< T >::Nullable ( SEXP  t)
inline

Standard constructor of a Nullable object

Parameters
SEXPis stored

Definition at line 56 of file Nullable.h.

References Rcpp::Nullable< T >::m_set, and Rcpp::Nullable< T >::m_sexp.

Member Function Documentation

template<class T >
T Rcpp::Nullable< T >::as ( )
inline

Returns m_sexp as a T

Definition at line 129 of file Nullable.h.

template<class T >
void Rcpp::Nullable< T >::checkIfSet ( void  ) const
inlineprivate
template<class T >
T Rcpp::Nullable< T >::clone ( ) const
inline

Return a clone of m_sexp as a T

Definition at line 134 of file Nullable.h.

References Rcpp::clone().

Here is the call graph for this function:

template<class T >
SEXP Rcpp::Nullable< T >::get ( ) const
inline

get() accessor for object

Exceptions
'notinitialized' if object has not been set

Definition at line 89 of file Nullable.h.

References Rcpp::Nullable< T >::checkIfSet(), and Rcpp::Nullable< T >::m_sexp.

Here is the call graph for this function:

template<class T >
bool Rcpp::Nullable< T >::isNotNull ( ) const
inline

Boolean test for not NULL

Exceptions
'notinitialized' if object has not been set

Definition at line 116 of file Nullable.h.

References Rcpp::Nullable< T >::isNull().

Here is the call graph for this function:

template<class T >
bool Rcpp::Nullable< T >::isNull ( ) const
inline

Boolean test for NULL

Exceptions
'notinitialized' if object has not been set

Definition at line 106 of file Nullable.h.

References Rcpp::Nullable< T >::checkIfSet(), and Rcpp::Nullable< T >::m_sexp.

Referenced by Rcpp::Nullable< T >::isNotNull().

Here is the call graph for this function:

template<class T >
bool Rcpp::Nullable< T >::isSet ( void  ) const
inline

Test function to check if object has been initialized

Definition at line 124 of file Nullable.h.

References Rcpp::Nullable< T >::m_set.

template<class T >
bool Rcpp::Nullable< T >::isUsable ( ) const
inline

Boolean test for usability as a T

Definition at line 97 of file Nullable.h.

References Rcpp::Nullable< T >::m_set, and Rcpp::Nullable< T >::m_sexp.

template<class T >
Rcpp::Nullable< T >::operator SEXP ( ) const
inline

operator SEXP() to return nullable object

Exceptions
'notinitialized' if object has not been set

Definition at line 79 of file Nullable.h.

References Rcpp::Nullable< T >::checkIfSet(), and Rcpp::Nullable< T >::m_sexp.

Here is the call graph for this function:

template<class T >
Nullable& Rcpp::Nullable< T >::operator= ( SEXP  sexp)
inline

Copy constructor for Nullable object

Parameters
SEXPis used to update internal copy

Definition at line 68 of file Nullable.h.

References Rcpp::Nullable< T >::m_set, and Rcpp::Nullable< T >::m_sexp.

Member Data Documentation

template<class T >
bool Rcpp::Nullable< T >::m_set
private

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