class DataLoopNode : public DataNode

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

Inheritance:


Public Fields

DataLoopNameListNode* myDefList
This is private, but doc++ doesn't realize that.
LoopTableNode myValList
This is private, but doc++ doesn't realize that.

Public Methods

StarFileNode::Status AddDataName (const string & name)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
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
StarFileNode::Status ChangeName (const string &oldName, const string &newName )
Find the old tag name in the loop and change it to the new name.
void FlattenNestedLoop ( List<DataNameNode*>* &L, List<DataValueNode*>* &M)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
virtual int getMaxDepth ( void )
Get the deepest depth of nesting of the entire loop
virtual bool isOfType ( ASTtype T )
virtual int myLongestStr ( void ) const
Returns the length of the longest string in this object
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
virtual ASTnode::ASTtype myType (void)
bool NotVirtualIsOfType ( ASTtype T )
StarFileNode::Status RemoveColumn ( const string name )
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
void reset ()
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
virtual ASTlist <DataValueNode *> * returnLoopValues (const string & tagName)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
DataLoopValListNode::Status returnNextLoopElement (DataValueNode* & v)
DEPRECIATED - instead use the STL vector-like methods outlined in the documentation for DataLoopNameListNode and LoopTableNode
virtual List <ASTnode*> * searchByTag ( string &searchFor )
Given a tag name, find the AST object it resides in
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
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
void tagPositionDeep ( string tagName, int *nestLevel, int *column )
Get the integer indexes that tell where the given tagname is located
private : StarFileNode::Status transform (DataLoopValListNode *l)
virtual bool unlinkChild ( ASTnode *child )
unlinks the given ASTnode from this ASTnode, assuming that the given ASTnode is a child of this ASTnode
virtual void Unparse (int indent)
virtual void Unparse (int indent, int )
virtual ~DataLoopNode ()
Destructor:

Public


void setTabFlag ( bool setTo )
bool getTabFlag ( void )

Sets (or gets) the value of the tab flag for this loop

level where it was found.

void setIndentFlag ( bool flg )
bool getIndentFlag ( void ) const

sets or gets the indention flag for the loop

void setRowsPerLine ( int setTo )
bool getRowsPerLine ( void ) const

Sets (or gets) the number of loop iterations to print on one line of text when unparsing

DataLoopNode (DataLoopNameListNode *d, DataLoopValListNode *l, const string &tflag = string("tabulate"))
DataLoopNode (const string &tflag)
DataLoopNode ( DataLoopNode& D)
Copy Constructor
DataLoopNode ( bool link, DataLoopNode& D)
Copy with parallel link
DataLoopNode ( DataLoopNameListNode* D, LoopTableNode L)

LoopTableNode& getVals ( void )
LoopTableNode* getValsPtr ( void )

getVals returns a reference or pointer to the LoopTableNode inside this DataValueNode

DataLoopNameListNode& getNames ( void )
DataLoopNameListNode* getNamesPtr ( void )

getNames returns a reference or pointer to the DataLoopNameListNode inside this DataValueNode

Inherited from DataNode:


Inherited from ASTnode:

Public Classes

enum ASTtype
ASTNODE
BLOCKNODE
DATABLOCKNODE
DATAFILENODE
DATAHEADINGNODE
DATAITEMNODE
DATALISTNODE
DATALOOPNAMELISTNODE
DATALOOPDEFLISTNODE
DEPRECIATED - Do not use:
DATALOOPNODE
DATALOOPVALLISTNODE
DATANAMENODE
DATANODE
DATAVALUENODE
GLOBALBLOCKNODE
GLOBALHEADINGNODE
HEADINGNODE
LOOPROWNODE
ITERNODE
DEPRECIATED - Do not use:
LOOPNAMELISTNODE
LOOPDEFLISTNODE
DEPRECIATED - Do not use:
LOOPTABLENODE
LOOPITER
DEPRECIATED - Do not use:
LOOPVALLISTNODE
DEPRECIATED - Do not use:
SAVEFRAMELISTNODE
SAVEFRAMENODE
SAVEHEADINGNODE
STARLISTNODE
STARFILENODE

Public Methods

virtual void copyFrom( const ASTnode ©FromMe )
virtual ASTnode* myParent(void)
virtual bool removeChild( ASTnode *child )
virtual bool removeMe( void )
virtual void setParent( ASTnode *p )
virtual size_t sizeOfMe(void)
virtual bool unlinkMe( void )

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.

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

DataLoopNode(const string &tflag)

DataLoopNode( DataLoopNode& D)
Copy Constructor

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.

DataLoopNode( DataLoopNameListNode* D, LoopTableNode L)

virtual ~DataLoopNode()
Destructor:

void setIndentFlag( bool flg )

bool getIndentFlag( void ) const

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.

void setRowsPerLine( int setTo )

bool getRowsPerLine( void ) const

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_

void setTabFlag( bool setTo )

bool getTabFlag( void )

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)

virtual ASTnode::ASTtype myType(void)

virtual bool isOfType( ASTtype T )

bool NotVirtualIsOfType( ASTtype T )

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

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

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

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

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

virtual void Unparse(int indent)

virtual void Unparse(int indent, int )

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

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

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

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.

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

LoopTableNode& getVals( void )

LoopTableNode* getValsPtr( void )

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.

DataLoopNameListNode& getNames( void )

DataLoopNameListNode* getNamesPtr( void )

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.

virtual 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

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

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

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

private : StarFileNode::Status transform(DataLoopValListNode *l)

level where it was found.

DataLoopNameListNode* myDefList
This is private, but doc++ doesn't realize that.

LoopTableNode myValList
This is private, but doc++ doesn't realize that.

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

virtual 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 hierarchy of classes


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

generated by doc++