libRDataFrame  0.815
A library with R style datatypes and associated utilities
 All Classes Files Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
node Class Reference

Public Member Functions

 node ()
 
 node (int r, std::string vName, std::string vType, int vNumber)
 
 node (void *pvData)
 
 node (int r, std::string vName, std::string vType, int vNumber, std::map< int, std::string > catSet)
 
 node (int r, std::string vName, std::string vType, int vNumber, void *pvData)
 
void * getVarDataRange (int start, int ending)
 
void * getPtrData ()
 
void * getVarData ()
 
std::string getVarName ()
 
std::string getVarType ()
 
int getVarNumber ()
 
int getNRows ()
 
std::vector< int > getNodeIntData ()
 
std::vector< int > getNodeIntData (void *pData)
 
std::vector< double > getNodeDblData ()
 
std::vector< double > getNodeDblData (void *pData)
 
std::vector< std::string > getNodeStrData ()
 
std::vector< std::string > getNodeStrData (void *pData)
 
std::vector< int > getNodeCatData ()
 
std::vector< int > getNodeCatData (void *pData)
 
void setNodeContent (int r, std::string vName, std::string vType, int vNumber, void *pvData)
 
void setVarDataRows (int r)
 
void setVarData (void *pvData)
 
void setVarName (std::string vName)
 
void setVarType (std::string vType)
 
void setVarNumber (int vNumber)
 
void displayNode ()
 
void displayName_Type ()
 
std::string toString ()
 

Protected Attributes

int nrows = 0
 
std::string varName = ""
 
std::string varType = ""
 
int varNumber = 0
 
void * ptrData = nullptr
 
void * retPtr = nullptr
 
std::vector< int > * ipData = nullptr
 
std::vector< double > * dpData = nullptr
 
std::vector< std::string > * spData = nullptr
 
std::vector< int > * cpData = nullptr
 
std::map< int, std::string > categorySet
 
std::vector< int > catVarData
 

Constructor & Destructor Documentation

node::node ( )

default constructor

node::node ( void *  pvData)

constructor meta-data blank, add vector pointer to data only

Parameters
void*pvData pointer to the vector of data

Member Function Documentation

void node::displayName_Type ( )

display the variable name and type

Parameters
none
Returns
none (void)
void node::displayNode ( )

display the whole node, meta-data and data

Parameters
nonefor(unsigned i =0; i < vData.size(); ++i) {}
Returns
none (void)
vector< int > node::getNodeCatData ( )

get Node data as a vector of categories or factors (OVERLOADED)

Parameters
pDataa pointer to the Node data (implied or stated)
Returns
ipData the pointer to a vector<int> with the Node data
vector< double > node::getNodeDblData ( )

get Node data as a vector of doubles (OVERLOADED)

Parameters
pDataa pointer to the Node data (implied or stated)
Returns
ipData the pointer to a vector<double> with the Node data
vector< int > node::getNodeIntData ( )

get Node data as a vector of integers (OVERLOADED)

Parameters
pDataa pointer to the Node data (implied or stated)
Returns
ipData the pointer to a vector<int> with the Node data
vector< std::string > node::getNodeStrData ( )

get Node data as a vector of strings (OVERLOADED)

Parameters
pDataa pointer to the Node data (implied or stated)
Returns
ipData the pointer to a vector<string> with the Node data
int node::getNRows ( )

get nrows, the number of data rows in the Node vector

Parameters
none
Returns
nrows, an int with the number of data rows in vector
void * node::getPtrData ( )

get pointer to variable data from the node vector requires knowledge of variable type to fetch pointer

Parameters
none
Returns
a pointer to the start of memory containing the data vector
void * node::getVarData ( )

get all of the variable data from the node vector as a raw data requires variable type to cast pointer

Parameters
none
Returns
a pointer to the start of memory containing the recast data vector
void * node::getVarDataRange ( int  start,
int  ending 
)

the Node class methods get a range of variable data from the node vector Remember! The varType needs to be used to type the data of the returned pointer

Parameters
start- the starting index for the range of data.
theending index for the range
Returns
a (void) pointer to the start of memory containing the data range
string node::getVarName ( )

get the variable name (node meta-datum varName)

Parameters
none
Returns
the variable name (string)
int node::getVarNumber ( )

get the variable (position) number (node meta-datum varNumber)

Parameters
none
Returns
the variable number (int)
string node::getVarType ( )

get the variable type (node meta-datum varType)

Parameters
none
Returns
the variable type (string)
void node::setNodeContent ( int  r,
std::string  vName,
std::string  vType,
int  vNumber,
void *  pvData 
)

set the variable data, with a pointer to the data vector

Parameters
r,intwith the number of rows in data vector (i.e its size)
vName,stringwith variable name
vType,stringwith variable type
vNumber,intwith variable (position number
vData,pointerto data vector
Returns
none, (void)
void node::setVarData ( void *  pvData)

set the variable data, with a pointer to the data vector

Parameters
pointerto data
Returns
none (void)
void node::setVarDataRows ( int  r)

set the variable data, with a pointer to the data vector

Parameters
r,thenumber of rows/elements in data vector
Returns
none (void)
void node::setVarName ( std::string  vName)

set the variable Name (nvector<int> year {data[0]};ode meta-datum varName)

Parameters
thevariable name (string)
Returns
none (void)
void node::setVarNumber ( int  vNumber)

set the variable (position)number (node meta-datum varNumber)

Parameters
thevariable type (string)
Returns
none (void)
void node::setVarType ( std::string  vType)

set / reset the variable type (node meta-datum varType) and convert vector and pointer type if necessary.

Parameters
thevariable type (string)
Returns
none (void)
string node::toString ( )

convert the node data to a string

Parameters
none
Returns
the node as a continuous string (potentially a string stream

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