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

#include <PNode.h>

Inheritance diagram for PNode:
DataNode OpNode

Public Member Functions

 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

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
 

Friends

std::ostream & operator<< (std::ostream &out, const PNode &node)
 

Detailed Description

PNode is a simple class. It just contains constructors and destructors The evaluator is held in another class, to hopefully make things more easily maintainable. It may not really be worthwhile.

Definition at line 45 of file PNode.h.

Constructor & Destructor Documentation

◆ PNode() [1/4]

PNode::PNode ( )

The Standard constructor.

This is the standard pNode constructor.

Definition at line 53 of file PNode.cpp.

53 :
55 mTrace(0),
56 mSourceFile(""),
57 mLineNumber(0),
58 mFunctName("")
59{
60
61
62}
@ PEBL_UNDEFINED_NODE
Definition PNode.h:34
PNODE_TYPE mType
Definition PNode.h:84
std::string mSourceFile
Source file of origin.
Definition PNode.h:92
int mLineNumber
Closest Line number of origin.
Definition PNode.h:95
std::string mFunctName
Definition PNode.h:97
int mTrace
Whether to produce a trace.
Definition PNode.h:88

◆ PNode() [2/4]

PNode::PNode ( const PNode pn)

Definition at line 76 of file PNode.cpp.

77{
78 mType = (pn.GetType());
80
81}
int GetLineNumber() const
Definition PNode.h:69
void SetFileInfo(const std::string &filename, int linenumber)
Definition PNode.cpp:102
PNODE_TYPE GetType() const
Access mType data.
Definition PNode.h:61
std::string GetFilename() const
Definition PNode.h:68

References GetFilename(), GetLineNumber(), GetType(), mType, and SetFileInfo().

◆ PNode() [3/4]

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

◆ PNode() [4/4]

PNode::PNode ( PNODE_TYPE  type,
const std::string &  filename,
int  linenumber 
)

◆ ~PNode()

PNode::~PNode ( )
virtual

The Standard destructor.

This is the standard pNode destructor.

Definition at line 83 of file PNode.cpp.

84{
85 // Standard Destructor
86}

Member Function Documentation

◆ DestroyChildren()

void PNode::DestroyChildren ( )
virtual

Reimplemented in OpNode.

Definition at line 112 of file PNode.cpp.

113{
114 //A generic PNode doesn't necessarily have children, so
115 //don't do anything.
116}

Referenced by PEBLEnvironment::CallFunction(), and OpNode::DestroyChildren().

◆ GetFilename()

std::string PNode::GetFilename ( ) const
inline

Definition at line 68 of file PNode.h.

68{return mSourceFile;};

References mSourceFile.

Referenced by Evaluator::Evaluate1(), PNode(), and PError::SignalWarning().

◆ GetFunctionName()

std::string PNode::GetFunctionName ( ) const
inline

Definition at line 71 of file PNode.h.

71{return mFunctName;};

References mFunctName.

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

◆ GetLineNumber()

int PNode::GetLineNumber ( ) const
inline

◆ GetType()

PNODE_TYPE PNode::GetType ( ) const
inline

◆ SendToStream()

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

Reimplemented in OpNode, and DataNode.

Definition at line 96 of file PNode.cpp.

97{
98 out << "<Anonymous PNode of Type: " << GetType() << ">" << flush;
99 return out;
100}

References GetType().

Referenced by operator<<().

◆ SetFileInfo()

void PNode::SetFileInfo ( const std::string &  filename,
int  linenumber 
)

Definition at line 102 of file PNode.cpp.

103{
104 mSourceFile = filename;
105 mLineNumber = linenumber;
106}

References mLineNumber, and mSourceFile.

Referenced by PNode().

◆ SetFunctionName()

void PNode::SetFunctionName ( const std::string &  funcname)

Definition at line 107 of file PNode.cpp.

108{
109 mFunctName = funcname;
110}

References mFunctName.

Referenced by Loader::LoadLibraryFunctions().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const PNode node 
)
friend

Member Data Documentation

◆ mFunctName

std::string PNode::mFunctName
protected

Definition at line 97 of file PNode.h.

Referenced by GetFunctionName(), and SetFunctionName().

◆ mLineNumber

int PNode::mLineNumber
protected

Closest Line number of origin.

Definition at line 95 of file PNode.h.

Referenced by GetLineNumber(), and SetFileInfo().

◆ mSourceFile

std::string PNode::mSourceFile
protected

Source file of origin.

Definition at line 92 of file PNode.h.

Referenced by GetFilename(), and SetFileInfo().

◆ mTrace

int PNode::mTrace
protected

Whether to produce a trace.

Definition at line 88 of file PNode.h.

◆ mType

PNODE_TYPE PNode::mType
protected

Stores what type of node This may allow for easier run-time type identification

Definition at line 84 of file PNode.h.

Referenced by GetType(), and PNode().


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