PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
DataNode Class Reference

#include <PNode.h>

Inheritance diagram for DataNode:
PNode

Public Member Functions

 DataNode (const Variant value, const std::string &filename, int linenumber)
 
 DataNode (const std::string &filename, int linenumber)
 
 DataNode (pInt ivalue, const std::string &filename, int linenumber)
 
 DataNode (pDouble fvalue, const std::string &filename, int linenumber)
 
virtual ~DataNode ()
 
VariantDataType GetDataType () const
 
const VariantGetValue () const
 
- Public Member Functions inherited from PNode
 PNode ()
 The Standard constructor.
 
 PNode (const PNode &pn)
 
 PNode (const std::string &filename, int linenumber)
 
 PNode (PNODE_TYPE type, const std::string &filename, int linenumber)
 
virtual ~PNode ()
 The Standard destructor.
 
PNODE_TYPE GetType () const
 Access mType data.
 
void SetFileInfo (const std::string &filename, int linenumber)
 
std::string GetFilename () const
 
int GetLineNumber () const
 
void SetFunctionName (const std::string &funcname)
 
std::string GetFunctionName () const
 
virtual void DestroyChildren ()
 

Protected Member Functions

virtual std::ostream & SendToStream (std::ostream &out) const
 

Protected Attributes

Variant mValue
 
- Protected Attributes inherited from PNode
PNODE_TYPE mType
 
int mTrace
 Whether to produce a trace.
 
std::string mSourceFile
 Source file of origin.
 
int mLineNumber
 Closest Line number of origin.
 
std::string mFunctName
 

Detailed Description

Definition at line 135 of file PNode.h.

Constructor & Destructor Documentation

◆ DataNode() [1/4]

DataNode::DataNode ( const Variant  value,
const std::string &  filename,
int  linenumber 
)

Definition at line 371 of file PNode.cpp.

371 :
372 PNode(PEBL_DATA_NODE, filename, linenumber),
373 mValue(0)
374{
375 //This automatically makes a deep copy (I think)
376#ifdef VERBOSE_PNODE_CONSTRUCTION_MESSAGES
377 cerr << "\tConstructing DataNode of variant value " << flush << value << endl;
378#endif
379
380 mValue = value;
381}
@ PEBL_DATA_NODE
Definition PNode.h:36
Variant mValue
Definition PNode.h:164
PNode()
The Standard constructor.
Definition PNode.cpp:53

References mValue.

◆ DataNode() [2/4]

DataNode::DataNode ( const std::string &  filename,
int  linenumber 
)

◆ DataNode() [3/4]

DataNode::DataNode ( pInt  ivalue,
const std::string &  filename,
int  linenumber 
)

◆ DataNode() [4/4]

DataNode::DataNode ( pDouble  fvalue,
const std::string &  filename,
int  linenumber 
)

◆ ~DataNode()

DataNode::~DataNode ( )
virtual

Definition at line 455 of file PNode.cpp.

456{
457#ifdef VERBOSE_PNODE_CONSTRUCTION_MESSAGES
458 cout <<" deleting DataNode: " << *this << endl;
459#endif
460}

Member Function Documentation

◆ GetDataType()

VariantDataType DataNode::GetDataType ( ) const
inline

Definition at line 149 of file PNode.h.

149{return mValue.GetDataType();};
VariantDataType GetDataType() const
This returns the type as an enum.
Definition Variant.cpp:885

References Variant::GetDataType(), and mValue.

◆ GetValue()

const Variant & DataNode::GetValue ( ) const
inline

Definition at line 152 of file PNode.h.

152{return mValue;};

References mValue.

Referenced by Evaluator::Evaluate(), Evaluator::Evaluate(), Evaluator::Evaluate1(), main(), and SendToStream().

◆ SendToStream()

ostream & DataNode::SendToStream ( std::ostream &  out) const
protectedvirtual

Reimplemented from PNode.

Definition at line 463 of file PNode.cpp.

464{
465 out << "<DataNode of Type: " << GetType() << " and Value: " << GetValue()<< ">" << flush;
466 return out;
467}
const Variant & GetValue() const
Definition PNode.h:152
PNODE_TYPE GetType() const
Access mType data.
Definition PNode.h:61

References PNode::GetType(), and GetValue().

Member Data Documentation

◆ mValue

Variant DataNode::mValue
protected

This union stores the primary data for the node. It will either be numeric value, a string, or a symbol.

Definition at line 164 of file PNode.h.

Referenced by DataNode(), GetDataType(), and GetValue().


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