UAPBuilder Class Reference

Defines the API to construct a UAP model from an input document. More...

#include <UAPBuilder.hpp>

Collaboration diagram for UAPBuilder:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 UAPBuilder (UAPNode *node)
 Creates a UAPBuilder and initializes it with the specified dialect translator and node.
 ~UAPBuilder ()
 Destructor.
void addChild (enum UAPNode_type type, std::string name)
 Adds a child Node to this model.
void addAttribute (std::string name, std::string value, bool allow_repeats=false)
 Adds an attribute to this model.
void moveToParent ()
 Switch focus to the parent of the current node.
UAPNodegetCurrentNode ()
 Returns the current node.
NodeVec getSubNodesByTagName (const std::string &tagName)
 Returns a list of all the UAPNode(s) with a given tag name in the order in which they are encountered in a preorder traversal of this UAP model.
UAPNodegetChildByName (const std::string &_name)
 Returns the first child node of the current node with the specified name.
UAPNodegetChildByName (UAPNode *beginPosition, const std::string &_name)
 Returns the first child node of the specified node with the specified name.
NodeVec getChildrenByName (const std::string &_name)
 Returns a list of children of the current node with the specified name.
NodeVec getChildrenByName (UAPNode *beginPosition, const std::string &_name)
 Returns a list of children of the specified node with the specified name.
UAPNodegetSubNodeByName (const std::string &_name)
 Returns the first sub-node node of the current node with the specified name.
UAPNodegetSubNodeByName (UAPNode *beginPosition, const std::string &_name)
 Returns the first sub-node node of the specified node with the specified name.
NodeVec getSubNodesByName (const std::string &_name)
 Returns a list of sub-noderen of the current node with the specified name.
NodeVec getSubNodesByName (UAPNode *beginPosition, const std::string &_name)
 Returns a list of children of the specified node with the specified name.


Detailed Description

Defines the API to construct a UAP model from an input document.

Using this class, an application programmer can obtain a UAP model.

Once a UAP model is obtained, it can be translated into a variety of formats.

Author:
Andy Wolski, Daniel Bates
Version:
1.6, 03/23/06

Definition at line 46 of file UAPBuilder.hpp.


Constructor & Destructor Documentation

UAPBuilder::UAPBuilder ( UAPNode node  ) 

Creates a UAPBuilder and initializes it with the specified dialect translator and node.

Parameters:
DialectTranslator the dialect translator
UAPNode the root node
See also:
UAPNode

Definition at line 28 of file UAPBuilder.cpp.

UAPBuilder::~UAPBuilder (  ) 

Destructor.

Definition at line 31 of file UAPBuilder.cpp.


Member Function Documentation

void UAPBuilder::addAttribute ( std::string  name,
std::string  value,
bool  allow_repeats = false 
)

Adds an attribute to this model.

This methods calls the UAPNode.addAttribute method with the specified name, value and allow_repeats arguments.

Parameters:
name the name of the attribute
value the value of the attribute
allow_repeats true to allow duplicate attributes; false if attributes must be unique. (default: false)
See also:
UAPNode::addAttribute

string

bool

Definition at line 47 of file UAPBuilder.cpp.

void UAPBuilder::addChild ( enum UAPNode_type  type,
std::string  name 
)

Adds a child Node to this model.

This methods calls the UAPNode.addChild method with the specified type and name arguments.

Parameters:
type the type of the child
name the name of the child
See also:
UAPNode::addChild

string

Definition at line 37 of file UAPBuilder.cpp.

UAPNode * UAPBuilder::getChildByName ( UAPNode beginPosition,
const std::string &  _name 
)

Returns the first child node of the specified node with the specified name.

Only the first level sub-nodes (the children) are searched. The search begins at the node beginPosition.

Parameters:
beginPosition the UAP node
_name The name of the node
Returns:
A child node which has the specified name. NULL if no node has the specified name.
See also:
getSubNodeByName

getSubNodesByName

UAPNode

string

Definition at line 62 of file UAPBuilder.cpp.

UAPNode * UAPBuilder::getChildByName ( const std::string &  _name  ) 

Returns the first child node of the current node with the specified name.

Only the first level sub-nodes (the children) are searched.

Parameters:
_name The name of the node.
Returns:
A child node which has the specified name. NULL if no node has the specified name.
See also:
getSubNodeByName

getSubNodesByName

UAPNode

string

Definition at line 54 of file UAPBuilder.cpp.

NodeVec UAPBuilder::getChildrenByName ( UAPNode beginPosition,
const std::string &  _name 
)

Returns a list of children of the specified node with the specified name.

Only the first level sub-nodes (the children) are searched.

Parameters:
beginPosition the parent of the children.
_name The name to match to.
Returns:
A list of child nodes.
See also:
getSubNodeByName

getSubNodesByName

UAPNode

string

Definition at line 79 of file UAPBuilder.cpp.

NodeVec UAPBuilder::getChildrenByName ( const std::string &  _name  ) 

Returns a list of children of the current node with the specified name.

Only the first level sub-nodes (the children) are searched.

Parameters:
_name the name of the node.
Returns:
A list of child nodes.
See also:
getSubNodeByName

getSubNodesByName

UAPNode

string

Definition at line 70 of file UAPBuilder.cpp.

UAPNode * UAPBuilder::getSubNodeByName ( UAPNode beginPosition,
const std::string &  _name 
)

Returns the first sub-node node of the specified node with the specified name.

All sub-nodes (children and sub-children) are searched. The search begins at the node beginPosition.

Parameters:
beginPosition the UAP node
_name the name of the node
Returns:
the node to which the name is mapped in this UAP model; NULL if the name is not mapped to any node in this UAP model.
See also:
getChildByName

getChildrenByName

UAPNode

string

Definition at line 99 of file UAPBuilder.cpp.

UAPNode * UAPBuilder::getSubNodeByName ( const std::string &  _name  ) 

Returns the first sub-node node of the current node with the specified name.

All sub-nodes (children and sub-children) are searched.

Parameters:
_name The name of the node.
Returns:
The node to which the name is mapped in this UAP model; NULL if the name is not mapped to any node in this UAP model.
See also:
getChildByName

getChildrenByName

UAPNode

string

Definition at line 88 of file UAPBuilder.cpp.

NodeVec UAPBuilder::getSubNodesByName ( UAPNode beginPosition,
const std::string &  _name 
)

Returns a list of children of the specified node with the specified name.

All sub-nodes (children and sub-children) are searched.

Parameters:
beginPosition the parent of the children.
_name the name to match to.
Returns:
A list of nodes.
See also:
getChildByName

getChildrenByName

UAPNode

string

Definition at line 120 of file UAPBuilder.cpp.

NodeVec UAPBuilder::getSubNodesByName ( const std::string &  _name  ) 

Returns a list of sub-noderen of the current node with the specified name.

All sub-nodes (children and sub-children) are searched.

Parameters:
_name the name of the node.
Returns:
A list of nodes.
See also:
getChildByName

getChildrenByName

UAPNode

string

Definition at line 110 of file UAPBuilder.cpp.

NodeVec UAPBuilder::getSubNodesByTagName ( const std::string &  tagName  ) 

Returns a list of all the UAPNode(s) with a given tag name in the order in which they are encountered in a preorder traversal of this UAP model.

Parameters:
tagName the name of the Nodes
Returns:
a list of UAPNodes.
See also:
UAPNode

void UAPBuilder::moveToParent (  ) 

Switch focus to the parent of the current node.

Definition at line 42 of file UAPBuilder.cpp.


Generated on Fri Feb 12 15:47:58 2010 for Universal Accelerator Parser by  doxygen 1.5.7