Rcpp Version 1.1.2
Loading...
Searching...
No Matches
Rcpp::Nullable< T > Class Template Reference

#include <Nullable.h>

Public Member Functions

 Nullable ()
 Nullable (const T &t)
 Nullable (SEXP t)
Nullable & operator= (SEXP sexp)
 operator SEXP () const
SEXP get () const
bool isUsable () const
bool isNull () const
bool isNotNull () const
bool isSet (void) const
T as ()
T 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 32 of file Nullable.h.

Constructor & Destructor Documentation

◆ Nullable() [1/3]

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 40 of file Nullable.h.

◆ Nullable() [2/3]

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 48 of file Nullable.h.

◆ Nullable() [3/3]

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

Standard constructor of a Nullable object

Parameters
SEXPis stored

Definition at line 55 of file Nullable.h.

Member Function Documentation

◆ as()

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

Returns m_sexp as a T

Definition at line 140 of file Nullable.h.

◆ checkIfSet()

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

◆ clone()

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

Return a clone of m_sexp as a T

Definition at line 145 of file Nullable.h.

◆ get()

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 100 of file Nullable.h.

Referenced by Rcpp::Nullable< Vector< REALSXP > >::as(), and Rcpp::Nullable< Vector< REALSXP > >::clone().

◆ isNotNull()

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 127 of file Nullable.h.

◆ isNull()

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 117 of file Nullable.h.

Referenced by Rcpp::Nullable< Vector< REALSXP > >::isNotNull().

◆ isSet()

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

Test function to check if object has been initialized

Definition at line 135 of file Nullable.h.

◆ isUsable()

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

Boolean test for usability as a T

Definition at line 108 of file Nullable.h.

◆ operator 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 78 of file Nullable.h.

◆ operator=()

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 67 of file Nullable.h.

Member Data Documentation

◆ m_set

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

Definition at line 149 of file Nullable.h.

◆ m_sexp

template<class T>
SEXP Rcpp::Nullable< T >::m_sexp
private

Definition at line 148 of file Nullable.h.


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