class LoopRowNode

This class is a single row of values in a loop.

Inheritance:


Public Methods

[more]void FlattenNestedLoop (List<DataValueNode*>* M)
DEPRECIATED - use the STL vector operations instead
[more]StarFileNode::Status RemoveColumnValues ( int nest, int ele )
DEPRECIATED - use the STL vector operations instead
[more]virtual void Unparse (int indent)
Print the output of this row of the list:
[more]virtual void Unparse (int indent, List<int>* presizes, List<int>* postsizes )
This version is for internal use only, but had to be made public for technical reasons - don't call it.
[more]void addInnerLoopValue (const DataLoopNameListNode::Status dstat, const int row, const int currRow, DVNWithPos* value)
DEPRECIATED - use the STL vector operations instead
[more]void addValue (DVNWithPos* value)
DEPRECIATED - use the STL vector operations instead
[more]const_reference back () const
[more]reference back ()
[more]const_iterator begin () const
[more]iterator begin ()
[more]bool empty () const
[more]iterator end ()
[more]const_iterator end () const
[more]const_reference front () const
[more]reference front ()
[more]int isInLoop (void)
isInLoop: Returns true if this LoopRowNode is inside a DataLoopNode, or false if it is not.
[more]virtual bool isOfType ( ASTtype T )
[more]virtual int myLongestStr ( void )
Returns the length of the longest string in this object.
[more]LoopTableNode* myLoop ( void )
Returns a pointer to the inner loop that is under this row.
[more]virtual ASTnode::ASTtype myType (void)
[more]const_reference operator[] ( size_type n) const
[more]reference operator[] ( size_type n )
[more]void reserve ( size_type n )
[more]void reset ()
DEPRECIATED - use the STL vector operations instead
[more]DataValueNode* returnLoopValue (unsigned position)
DEPRECIATED - use the STL vector operations instead
[more]DataLoopValListNode::Status returnNextLoopElement (DataValueNode* & v)
DEPRECIATED - use the STL vector operations instead
[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 setMyLoop ( LoopTableNode* tbl )
Sets the interior loop under this row.
[more]size_type size () const
[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 ~LoopRowNode ()
Destructor - recursively destructs the values in the loop too

Public Members

[more]
class const_iterator
This iterator class is meant to behave just like the iterator class inside an STL vector.
class iterator
This iterator class is meant to behave just like the iterator class inside an STL vector.


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 List<ASTnode*> * searchByTag( char* searchFor)
ovirtual List<ASTnode*> * searchByTag( string &searchFor)
ovirtual void setParent( ASTnode* p )
ovirtual bool unlinkMe( void )

Public Members

oenum ASTtype

Protected Methods

ovoid printIndent(int indent)


Inherited from ASTnodeWithPosBits:


Documentation

This class is a single row of values in a loop.

A single row of values in the loop is a list (STL vector) of DataValueNodes. In addition each loop row can have a table of values hanging "under" it at the next nesting level. And the rows of that table can have other tables under them, and so on.

oiterator begin()

oiterator end()

oconst_iterator begin() const

oconst_iterator end() const

osize_type size() const

obool empty() const

oreference operator[]( size_type n )

oconst_reference operator[]( size_type n) const

oreference front()

oconst_reference back() const

oconst_reference front() const

oreference back()

ovoid reserve( size_type n )

oint isInLoop(void)
isInLoop: Returns true if this LoopRowNode is inside a DataLoopNode, or false if it is not. (In a complete STAR tree it is always true, but when building up a loop piece by piece an LoopRowNode might not have been attached to a loop yet.)

The value returned is an integer. It is a count of how many nesting levels deep this is in the loop that it was found it. Thus if it is zero (false) it was not found in a loop, and if it is 1 then it was found in nesting level 1 of a loop, 2 = nesting level 2, etc.

Note that this is off-by-one with the index used in the [] operator, which starts counting at zero. This was done so that this method could be used like a boolean. (zero means not found, nonzero means found).

oLoopTableNode* myLoop( void )
Returns a pointer to the inner loop that is under this row. If no such loop, a NULL is returned. Note that even if a loop is returned, that this loop might have zero rows in it, which should be treated the same as not having an inner loop at all.

ovoid setMyLoop( LoopTableNode* tbl )
Sets the interior loop under this row. Not to be used outside the parser, but it needs to be made public anyway due to technical difficulties in the bison parser - there is no guarantee that this routine will work correctly in the future.
Parameters:
tbl - LoopTableNode to place under this row as an inner table.

ovirtual ~LoopRowNode()
Destructor - recursively destructs the values in the loop too

ovirtual void Unparse(int indent)
Print the output of this row of the list:

ovirtual void Unparse(int indent, List<int>* presizes, List<int>* postsizes )
This version is for internal use only, but had to be made public for technical reasons - don't call it. Call the other version of Unparse()

ovirtual ASTnode::ASTtype myType(void)

ovirtual bool isOfType( ASTtype T )

ovoid addValue(DVNWithPos* value)
DEPRECIATED - use the STL vector operations instead

ovoid addInnerLoopValue(const DataLoopNameListNode::Status dstat, const int row, const int currRow, DVNWithPos* value)
DEPRECIATED - use the STL vector operations instead

ovoid FlattenNestedLoop(List<DataValueNode*>* M)
DEPRECIATED - use the STL vector operations instead

ovoid reset()
DEPRECIATED - use the STL vector operations instead

oDataLoopValListNode::Status returnNextLoopElement(DataValueNode* & v)
DEPRECIATED - use the STL vector operations instead

oDataValueNode* returnLoopValue(unsigned position)
DEPRECIATED - use the STL vector operations instead

oStarFileNode::Status RemoveColumnValues( int nest, int ele )
DEPRECIATED - use the STL vector operations instead

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.

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.

Parameters:
type - type to search for.
delim - the delimiter type to search for if searching for DataValueNode's (default is "dont-care").

o

ovoid setTabFlag( bool setTo )

obool getTabFlag( void )

o Sets (or gets) the tabulation flag for this row, and all nested loops inside it.
Sets (or gets) the tabulation flag for this row, and all nested loops inside it. true = tab, false = linear.

o LoopRowNode( const bool tflag )
Parameters:
tflag - true = loop is tabular, false = loop is linear (only important when outputting with Unparse()).

o LoopRowNode( const bool tflag, size_t initSize )
Parameters:
tflag - true = loop is tabular, false = loop is linear (only important when outputting with Unparse()).
initSize - = the initial allocated capacity of the vector. (Not the actual size of the vector)

o LoopRowNode( IterNode& N)
Copy Constructor

o LoopRowNode( bool link, IterNode& N)
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 LoopRowNode( vector<DataValueNode*> &v, const bool tflag = false )
Make a new Iternode with the values given in the vector. (ASTlist is derived from vector, so an ASTlist can be used as the argument as well.)

o
 	  *-------------------------------------------------- 	  * insert() and erase()    * 	  *-------------------------------------------------- 	  * The following functions will only work if this LoopRowNode has not 	  * yet been attached to a loop in a STAR tree.
	  *--------------------------------------------------
	  * insert() and erase()    *
	  *--------------------------------------------------
	  * The following functions will only work if this LoopRowNode has not
	  * yet been attached to a loop in a STAR tree.  if this LoopRowNode
	  * *HAS* been attached to a loop in the STAR tree already, then these
	  * methods will be disallowed because that would cause a mismatch
	  * between the number of values in the loop row and the number of
	  * tagnames for the loop.
	  *
	  *    Thus this can work:
	  *           DataLoopNode  some_loop;
	  *           LoopRowNode  some_row;
	  *           ...
	  *           some_row.insert( some_row.end(),
	  *                            new DataValueNode( "hello" );
	  *           some_row.insert( some_row.end(),
	  *                            new DataValueNode( "world" );
	  *           some_loop.getVals.insert( begin(), some_row );
	  *               * (it only works assuming that two values per row is
	  *               * the proper amount for some_loop, else it's an error.)
	  *
	  *    But this will not work:
	  *           DataLoopNode  some_loop;
	  *           LoopRowNode  some_row;
	  *           ...
	  *           ...
	  *           some_loop.getVals[0].insert( end(),
	  *                                        new DataValueNode( "hello " );
	  *               * (You cannot insert or delete values from a row
	  *               * of data that is already in a loop.  You can only
	  *               * insert or delete entire rows at a time from an
	  *               * existing loop.)
	  *

* * Insert - Insert before 'pos', the data value given by * 'v'. Returns true if it worked or false otherwise. * (Will fail if the number of values does not match * what is in the loop's tagname list.) * *

obool insert( iterator pos, DataValueNode* v )
Make a link to the node given: (so don't delete it):

obool erase( iterator pos )
erase - Remove the value given

obool erase( iterator from, iterator to )
erase - Remove the range of values given as [from,to)

o These types are for use with the STL vector-like methods of this class
These types are for use with the STL vector-like methods of this class

otypedef value_type* pointer

otypedef const value_type* const_pointer

otypedef value_type& reference

otypedef const value_type& const_reference

otypedef size_t size_type

otypedef size_t difference_type

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. (In this case it is the longest datavalue from the list: )


This class has no child classes.
Friends:
class LoopTableNode

Alphabetic index HTML hierarchy of classes or Java


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