class DataLoopNode

A DataLoopNode is a list of tagnames and a list of values for those names.

Inheritance:


Public Methods

[more]StarFileNode::Status AddDataName (const string & name)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
[more]StarFileNode::Status AddDataValue ( const string & value, DataValueNode::ValType type )
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
[more]StarFileNode::Status ChangeName (const string &oldName, const string &newName )
Find the old tag name in the loop and change it to the new name
[more]void FlattenNestedLoop ( List<DataNameNode*>* &L, List<DataValueNode*>* &M)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
[more]bool NotVirtualIsOfType ( ASTtype T )
[more]StarFileNode::Status RemoveColumn ( const string name )
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
[more]virtual void Unparse (int indent)
[more]virtual void Unparse (int indent, int )
[more]virtual int getMaxDepth ( void )
Get the deepest depth of nesting of the entire loop.
[more]LoopTableNode& getVals ( void )
[more]LoopTableNode* getValsPtr ( void )
[more]virtual bool isOfType ( ASTtype T )
[more]virtual int myLongestStr ( void ) const
Returns the length of the longest string in this object.
[more]virtual string myName () const
Return the name of the loop (arbitrarily chosen to be the name of the first tag in the loop's names
[more]virtual ASTnode::ASTtype myType (void)
[more]void reset ()
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
[more]virtual ASTlist<DataValueNode *> * returnLoopValues (const string & tagName)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
[more]DataLoopValListNode::Status returnNextLoopElement (DataValueNode* & v)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
[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]void setNames ( DataLoopNameListNode &N )
Although this method is public, you should not use it.
[more]void setVals ( LoopTableNode &L )
Although this method is public, you should not use it.
[more]void tagPositionDeep ( string tagName, int* nestLevel, int* column )
Get the integer indexes that tell where the given tagname is located.
[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 ~DataLoopNode ()
Destructor:

Public Members

[more]
[more] getVals returns a reference or pointer to the LoopTableNode inside this DataValueNode.


Inherited from DataNode:


Inherited from ASTnode:

Public Methods

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)


Inherited from ASTnodeWithPosBits:


Documentation

A DataLoopNode is a list of tagnames and a list of values for those names. It corresponds to a 'loop' in a STAR file.
ovirtual ~DataLoopNode()
Destructor:

o

ovoid setTabFlag( bool setTo )

obool getTabFlag( void )

o Sets (or gets) the value of the tab flag for this loop.
Sets (or gets) the value of the tab flag for this loop. The tab flag determines if the loop prints out in tabular format or linear format (tabular = row all on one line, linear = one value per text line.) This only affects the unparsing of the loop and nothing else. (true = tabular, false = linear)

ovoid setRowsPerLine( int setTo )

obool getRowsPerLine( void ) const

o Sets (or gets) the number of loop iterations to print on one line of text when unparsing.
Sets (or gets) the number of loop iterations to print on one line of text when unparsing. This only has meaning when the loop is tabulated, and is ignored when the loop is linearly printed. The default is 1. Here is an example of what it would look like if it were set to 3:
	*     loop_
	*         _foo
	*         _bar
	*
	*         fooval1  barval1   fooval2  barval2   fooval3  barval3
	*         fooval4  barval4   fooval5  barval5   fooval6  barval6
	*     stop_
	* 

ovoid setIndentFlag( bool flg )

obool getIndentFlag( void ) const

o sets or gets the indention flag for the loop.
sets or gets the indention flag for the loop. If it is true then the loop's values are indented normally, if it is false, then the values are not indented from the margin. This only affects how the loop will be printed when calling Unparse(). The default value made by the constructor is true.

o DataLoopNode(DataLoopNameListNode* d, DataLoopValListNode* l, const string &tflag = string("tabulate"))

o DataLoopNode(const string &tflag)

o DataLoopNode( DataLoopNode& D)
Copy Constructor

o DataLoopNode( bool link, DataLoopNode& D)
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.

o DataLoopNode( DataLoopNameListNode* D, LoopTableNode L)

ovirtual ASTnode::ASTtype myType(void)

ovirtual bool isOfType( ASTtype T )

obool NotVirtualIsOfType( ASTtype T )

ovirtual string myName() const
Return the name of the loop (arbitrarily chosen to be the name of the first tag in the loop's names

ovoid FlattenNestedLoop( List<DataNameNode*>* &L, List<DataValueNode*>* &M)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode

oDataLoopValListNode::Status returnNextLoopElement(DataValueNode* & v)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode

ovirtual ASTlist<DataValueNode *> * returnLoopValues(const string & tagName)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode

ovoid reset()
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode

ovirtual void Unparse(int indent)

ovirtual void Unparse(int indent, int )

ovoid tagPositionDeep( string tagName, int* nestLevel, int* column )
Get the integer indexes that tell where the given tagname is located. For example, the first tag in the outermost loop would be returned as nestLevel = 0, column = 0. The third tag in the second nesting level would be returned as nestLevel = 1, column = 2. (values start counting at zero, like array indeces). Negative values are returned if the tag was not found in this loop. The search is case-insensitive.

oStarFileNode::Status RemoveColumn( const string name )
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode

oStarFileNode::Status AddDataName(const string & name)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode

oStarFileNode::Status AddDataValue( const string & value, DataValueNode::ValType type )
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode

oStarFileNode::Status ChangeName(const string &oldName, const string &newName )
Find the old tag name in the loop and change it to the new name

ovoid setVals( LoopTableNode &L )
Although this method is public, you should not use it. It was made public merely because of a technical difficulty in the parser that prevented it from working any other way.

ovoid setNames( DataLoopNameListNode &N )
Although this method is public, you should not use it. It was made public merely because of a technical difficulty in the parser that prevented it from working any other way.

oLoopTableNode& getVals( void )

oLoopTableNode* getValsPtr( void )

o getVals returns a reference or pointer to the LoopTableNode inside this DataValueNode.
getVals returns a reference or pointer to the LoopTableNode inside this DataValueNode. The loopIter returned is the outermost loop in the node. The LoopTableNode returned can be manipulated directly. This is the intended way to add/modify/read/delete the data in the loop. If the layout of the loop needs to be changed, however, by adding or removing a tagname, then the getNames() method needs to be used instead to manipulate that information first. For more information, see the LoopTableNode class.

oDataLoopNameListNode& getNames( void )

oDataLoopNameListNode* getNamesPtr( void )

o getNames returns a reference or pointer to the DataLoopNameListNode inside this DataValueNode.
getNames returns a reference or pointer to the DataLoopNameListNode inside this DataValueNode. It can be manipulated directly to alter the tags in the loop. In general, when tags are altered, new information is automatically inserted into the loop or deleted from the loop so that the STAR syntax is not violated. For more information, see the DataLoopNameListNode class.

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 strign 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.

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.

(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 name...
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 - type to search for
delim - the delimiter type if searching for a DataValueNode. 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.

ovirtual int myLongestStr( void ) const
Returns the length of the longest string in this object. Used by Unparse() at various levels of the AST tree. In this case it returns the longest tagname, not the longest data value.

ovirtual int getMaxDepth( void )
Get the deepest depth of nesting of the entire loop. -1 = this is not in a loop, so the question is meaningless. 0 = only outermost level of nesting exists. 1 = two levels of nesting 2 = three levels of nesting ...etc...


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