class DataListNode

Holds a list of the kinds of things that can be in a DataBlockNode.

Inheritance:


Public Methods

[more]StarFileNode::Status AddSaveFrame (const string & name)
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Add an empty save frame to the star file, labelling it eith the name given.
[more]StarFileNode::Status AddSaveFrameDataItem ( const string & name, const string & value, DataValueNode::ValType type)
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Add a data item to the save frame, with the name/value pair given.
[more]StarFileNode::Status AddSaveFrameLoop ()
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Add a loop to the last save frame in the star file.
[more]StarFileNode::Status AddSaveFrameLoopDataName (const string & name)
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Add a new name to the loop at the end of the last save frame of the file.
[more]StarFileNode::Status AddSaveFrameLoopDataValue ( const string & value, DataValueNode::ValType type )
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Add a new value to the end of the loop at the end of the last save frame of the file.
[more]void AddSaveFrameToDataBlock (DataNode* newNode)
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Given a save frame, adds it to the datablock name given.
[more]ASTlist<DataNode*> * GiveMyDataList ( void )
Returns a list of all DataNodes in the data list.
[more]void RemoveSaveFrame (string saveframe)
DEPRECIATED - use STL vector erase() on the list returned by GiveMyDataList instead
Remove the save frame matching the given name.
[more]DataNode* ReturnDataBlockDataNode (string saveframeName)
DEPRECIATED - use searchByTag() instead
Return the datanode (usually a saveframe) that matches the name given)
[more]virtual void Unparse (int indent)
[more]virtual bool isOfType ( ASTtype T )
[more]virtual int myLongestStr ( void )
Returns the length of the longest string in this object.
[more]virtual ASTnode::ASTtype myType (void)
[more]virtual void reserve ( size_t initSize )
Just like the vector method of the same name
[more]virtual List<ASTnode*> * searchByTag ( string &searchFor)
Given a tag name, find the AST object it resides in.
[more]virtual List<ASTnode*> * searchByTagValue ( string &tag, string &value )
Given a tag name and a value, find the AST object that that particular tag and value pair resides in.
[more]virtual List<ASTnode*> * searchForType ( ASTtype type, int delim = -1 )
This method returns a list of all the nodes of the given type that are inside this node, or children of this node, or children of children of this node, etc all the way down to the leaf nodes.
[more]virtual bool unlinkChild ( ASTnode* child )
unlinks the given ASTnode from this ASTnode, assuming that the given ASTnode is a child of this ASTnode.
[more]virtual ~DataListNode ()
Destructor - Recursively destroys the items inside the node as well

Public Members

[more]


Inherited from ASTnode:

Public Methods

obool NotVirtualIsOfType( ASTtype T )
ovirtual void copyFrom( const ASTnode &copyFromMe )
ovirtual ASTnode* myParent(void)
ovirtual bool removeChild( ASTnode* child )
ovirtual bool removeMe( void )
ovirtual void setParent( ASTnode* p )
ovirtual bool unlinkMe( void )

Public Members

oenum ASTtype

Protected Methods

ovoid printIndent(int indent)


Documentation

Holds a list of the kinds of things that can be in a DataBlockNode.

(This means SaveFrameNodes, DataLoopNodes, and DataItemNodes)

o

o DataListNode( DataListNode &L)
Recursive deep copy - use this for most copying needs

o DataListNode(ASTlist<DataNode* >* L)
Shallow dumb copy - don't use this unless you really know the insides of the library well

o DataListNode()
Make an empty list

o DataListNode( bool link, DataListNode &L )
Copy with parallel link. Set "link" to true to create a copy with a parallel link, or set it to false to create a copy without a parallel link. See the external documentation for more details on parallel copies.

ovirtual ~DataListNode()
Destructor - Recursively destroys the items inside the node as well

ovirtual void reserve( size_t initSize )
Just like the vector method of the same name

ovirtual ASTnode::ASTtype myType(void)

ovirtual bool isOfType( ASTtype T )

oASTlist<DataNode*> * GiveMyDataList( void )
Returns a list of all DataNodes in the data list. This list can then be used like an STL vector to manipulate the items inside the list to add new nodes, erase nodes, or iterate over nodes.

ovoid RemoveSaveFrame(string saveframe)
DEPRECIATED - use STL vector erase() on the list returned by GiveMyDataList instead
Remove the save frame matching the given name.
See Also:
GiveMyDataList

oDataNode* ReturnDataBlockDataNode(string saveframeName)
DEPRECIATED - use searchByTag() instead
Return the datanode (usually a saveframe) that matches the name given)
See Also:
searchByTag

ovoid AddSaveFrameToDataBlock(DataNode* newNode)
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Given a save frame, adds it to the datablock name given. The save frame is passed as a generic DataNode, rather than a SaveFrameNode. The DataNode given is hooked right into the star tree, no copied, so don't delete it after adding it.
See Also:
GiveMyDataList

ovirtual void Unparse(int indent)

oStarFileNode::Status AddSaveFrame(const string & name)
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Add an empty save frame to the star file, labelling it eith the name given. Adds at the end.
See Also:
GiveMyDataList

oStarFileNode::Status AddSaveFrameDataItem( const string & name, const string & value, DataValueNode::ValType type)
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Add a data item to the save frame, with the name/value pair given. Adds to the last save frame in the star file tree. returns ERROR if the last thing in the star file is not a save frame.
See Also:
GiveMyDataList

oStarFileNode::Status AddSaveFrameLoop()
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Add a loop to the last save frame in the star file. returns ERROR if the last thing in the star file is not a save frame.
See Also:
GiveMyDataList

oStarFileNode::Status AddSaveFrameLoopDataName(const string & name)
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Add a new name to the loop at the end of the last save frame of the file. returns ERROR if the last thing in the save frame is not a loop, or if the last thing in the AST is not a save frame.
See Also:
GiveMyDataList

oStarFileNode::Status AddSaveFrameLoopDataValue( const string & value, DataValueNode::ValType type )
DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead
Add a new value to the end of the loop at the end of the last save frame of the file. returns ERROR if the last thing in the save frame is not a loop, or if the last thing in the AST is not a save frame.
See Also:
GiveMyDataList

ovirtual List<ASTnode*> * searchByTag( string &searchFor)
Given a tag name, find the AST object it resides in. It returns a pointer to the lowest level AST object that the tag resides in. The caller of this function needs to use the isOfType() and/or myType() methods to determine what type to cst the object. Returns a NULL if nothing was found.

This search is case-insensitive. The names of things, according to the STAR specification, are supposed to be case-insensitive. This is being applied not only to tag names but also to saveframe names and datablock names.

WARNING: The list returned is allocated in heap space. It is the caller's responsibility to delete the list after it is no longer needed.

Parameters:
searchFor - Look for this string as the tag name

ovirtual List<ASTnode*> * searchByTagValue( string &tag, string &value )
Given a tag name and a value, find the AST object that that particular tag and value pair resides in. This is like performing an SQL search: WHERE tag = value.

(However, the values are case-sensitive. A search for a tag of _t1 is identical to a search for a tag of _T1, but a search for a value of "V1" is different from a search for a value of "v1".)

WARNING: The list returned is allocated in heap space. It is the caller's responsibility to delete the list after it is no longer needed.

Parameters:
- tag Look for this tag
value - Where it has this value

ovirtual List<ASTnode*> * searchForType( ASTtype type, int delim = -1 )
This method returns a list of all the nodes of the given type that are inside this node, or children of this node, or children of children of this node, etc all the way down to the leaf nodes.
Parameters:
type - Look for this type of node
delim - If the node is a DataValueNode, then look specificly for values with this kind of delimiter. The default if it is left off is "dont-care".

ovirtual bool unlinkChild( ASTnode* child )
unlinks the given ASTnode from this ASTnode, assuming that the given ASTnode is a child of this ASTnode. Does NOT call the destructor of the child node!! Use this function to remove the child from this ASTnode but not free it's space. RETURNS: true if the child was unlinked. false if the given ASTnode was not even in this class anywhere, and therefore nothing was done. This function MUST be overridden for each subclass of ASTnode.

ovirtual int myLongestStr( void )
Returns the length of the longest string in this object. Used by Unparse() at various levels of the AST tree. Basicly it calculates the longest string in the list of kids.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java


Starlib is a creation of BioMagResBank: bmrb.wisc.edu starlib banner