Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members   Related Pages  

Scope Class Reference

The Scope class keeps track of defined nodes and prototypes. More...

List of all members.


Public Methods

 Scope (const std::string &id, const ScopePtr &scope=ScopePtr())
 Constructor.

virtual ~Scope ()
 Destructor.

void addNodeType (const NodeTypePtr &nodeType)
 Add a node type.

const NodeTypePtr findType (const std::string &name) const
 Find a node type, given a type name. Returns NULL if type is not defined.

const NodeTypePtr firstType () const
NodefindNode (const std::string &name) const

Public Attributes

const std::string id
const ScopePtr parent

Private Methods

 Scope (const Scope &)
Scope & operator= (const Scope &)

Private Attributes

std::list< NodeTypePtrnodeTypeList
std::map< std::string, Node * > namedNodeMap

Friends

class Node

Detailed Description

The Scope class keeps track of defined nodes and prototypes.

PROTO definitions add node types to the namespace. PROTO implementations are a separate node type namespace, and require that any nested PROTOs NOT be available outside the PROTO implementation. PROTOs defined outside the current namespace are available.


Constructor & Destructor Documentation

Scope const std::string &    id,
const ScopePtr   parent = ScopePtr()
[explicit]
 

Constructor.

Parameters:
id the identifier for the scope.
parent the parent scope.

~Scope   [virtual]
 

Destructor.


Member Function Documentation

void addNodeType const NodeTypePtr   nodeType
 

Add a node type.

Print an error message if the argument type is already defined.

Parameters:
nodeType a NodeTypePtr

Todo:
Throw std::invalid_argument if the argument type is already defined.

const NodeTypePtr findType const std::string &    id const
 

Find a node type, given a type name. Returns NULL if type is not defined.