CXXR (C++ R)
Classes | Namespaces | Macros | Typedefs | Functions
VectorBase.h File Reference

($Id: VectorBase.h 1351 2013-03-08 15:12:28Z arr $)

Class CXXR::VectorBase and associated C interface. More...

#include "CXXR/RObject.h"
#include <boost/serialization/access.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/nvp.hpp>
#include "CXXR/ElementTraits.hpp"
#include "CXXR/GCStackRoot.hpp"
#include "CXXR/SEXP_downcast.hpp"
Include dependency graph for VectorBase.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CXXR::VectorBase
 Untemplated base class for R vectors. More...

Namespaces

namespace  CXXR
 Namespace for the CXXR project.

Macros

#define R_LEN_T_MAX   INT_MAX

Typedefs

typedef int R_len_t

Functions

int LENGTH (SEXP x)
int TRUELENGTH (SEXP x)
void SETLENGTH (SEXP x, int v)
void SET_TRUELENGTH (SEXP x, int v)
SEXP Rf_allocVector (SEXPTYPE stype, R_len_t length)
 Create a vector object.
Rboolean Rf_isVector (SEXP s)
 Is an RObject a vector?

Detailed Description

Class CXXR::VectorBase and associated C interface.


Function Documentation

int LENGTH ( SEXP  x)
inline
Parameters:
xPointer to an CXXR::VectorBase .
Returns:
The length of x, or 0 if x is a null pointer. (In the case of certain hash tables, this means the 'capacity' of x , not all of which may be used.)
SEXP Rf_allocVector ( SEXPTYPE  stype,
R_len_t  length 
)

Create a vector object.

Allocate a vector object. This ensures only validity of SEXPTYPE values representing lists (as the elements must be initialized). Initializing of other vector types is done in do_makevector().

Parameters:
stypeThe type of vector required.
lengthThe length of the vector to be created.
Returns:
Pointer to the created vector.
Rboolean Rf_isVector ( SEXP  s)

Is an RObject a vector?

Vector in this context embraces R matrices and arrays.

Parameters:
sPointer to the RObject to be tested. The pointer may be null, in which case the function returns FALSE.
Returns:
TRUE iff s points to a vector object.
void SET_TRUELENGTH ( SEXP  x,
int  v 
)
inline

Set 'true length' of vector.

Parameters:
xPointer to a CXXR::VectorBase .
vThe required new 'true length'.
Deprecated:
May be withdrawn in the future.
void SETLENGTH ( SEXP  x,
int  v 
)

Set length of vector.

Parameters:
xPointer to a CXXR::VectorBase .
vThe required new length, which must not be greater than the current length.
Deprecated:
May be withdrawn in future. Currently used in library/stats/src/isoreg.c , and possibly in packages.
int TRUELENGTH ( SEXP  x)
inline
Parameters:
xPointer to a CXXR::VectorBase .
Returns:
The 'true length' of x. According to the R Internals document for R 2.4.1, this is only used for certain hash tables, and signifies the number of used slots in the table.
Deprecated:
May be withdrawn in the future.