2.2.3.17.45 TreeNode::TypeIDTypeID
ClassName
TreeNode
AccessType
public
Name
TypeID
Declaration
int TypeID
Remark
TypeID data member identifies the data type of the node. internally this value is used for complex data for type identification however this has write access and programmer can use this for private types too.
internal values are(defined in OC_Const.h):
TNVAL_TYPE_BIT_VECTOR = 0x00010000UL,
TNVAL_TYPE_CHAR_VECTOR,
TNVAL_TYPE_SHORT_VECTOR,
TNVAL_TYPE_INT_VECTOR,
TNVAL_TYPE_FLOAT_VECTOR,
TNVAL_TYPE_DOUBLE_VECTOR,
TNVAL_TYPE_COMPLEX_VECTOR,
TNVAL_TYPE_CSTRING_VECTOR,
TNVAL_TYPE_POINTER_VECTOR,
TNVAL_TYPE_VARIANT_VECTOR,
TNVAL_TYPE_BIT_MATRIX = 0x00040000UL,
TNVAL_TYPE_CHAR_MATRIX,
TNVAL_TYPE_SHORT_MATRIX,
TNVAL_TYPE_INT_MATRIX,
TNVAL_TYPE_FLOAT_MATRIX,
TNVAL_TYPE_DOUBLE_MATRIX,
TNVAL_TYPE_COMPLEX_MATRIX,
TNVAL_TYPE_CSTRING_MATRIX,
TNVAL_TYPE_POINTER_MATRIX,
TNVAL_TYPE_VARIANT_MATRIX,
Examples
EX1
void TreeNode_TypeID_ex1()
{
Tree tr;
TreeNode tn = tr.AddNode("MatrixData");
matrix<double> myMatrix = {{1,2},{3,4}};
tn.dVals2 = myMatrix; //dVals2's type is double matrix
int nTypeStored = tn.TypeID;
int nTypeShouldBe = TNVAL_TYPE_DOUBLE_MATRIX;
if (nTypeStored == nTypeShouldBe)
out_str("Node type is double matrix\n");
else
out_str("Node type is not double matrix\n");
}
Description
Identifies the data type of the node.
Header to Include
origin.h
See Also
Reference
|