class LoopTableNode

A LoopTableNode is a table of rows in a DataLoopNode.

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
(Removing the tagname from the name list with the erase() operator causes it to remove the values under that name)
[more]virtual void Unparse (int indent)
[more]void addValue (const DataLoopNameListNode::Status dstat, const int row, const int currRow, DVNWithPos* value)
DEPRECIATED - use the STL vector operations instead
[more]const_reference back () const
[more]reference back ()
[more]iterator begin ()
[more]const_iterator begin () const
[more]List<int> * checkValueAlignment (void)
Test the Loop Table to see if there are any lines where the values on the line don't "align" with the names in the taglist.
[more]bool empty () const
[more]const_iterator end () const
[more]iterator end ()
[more]reference front ()
[more]const_reference front () const
[more]int getNumCols ( void )
Gets the number of columns in this LoopTableNode, by looking up at the list of names for this loop.
[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]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]ASTlist<DataValueNode *> * returnLoopValues (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]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 ~LoopTableNode ()

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.

Protected Methods

[more]virtual void calcPrintSizes ( List<int>** presizes, List<int>** postsizes )


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

A LoopTableNode is a table of rows in a DataLoopNode.

You can think of a loop in a STAR file as being a table of values, with each iteration of the loop being a row on the table. This is the view taken by the starlib. Things are further complicated by the fact that each row of the table can have another table under it (another nesting level), but even then, those tables are the same structure as the outermost one.

Thus, this class, LoopTableNode, stores a table at some arbitrary nesting level in the loop. A simple singly nested loop will have only one loop table node, but a multiply nested loop will have a whole tree of loop tables.

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 getNumCols( void )
Gets the number of columns in this LoopTableNode, by looking up at the list of names for this loop. If this LoopTableNode is not inside a DataLoopNode yet, then a zero is returned.

ovirtual ~LoopTableNode()

ovirtual void Unparse(int indent)

ovirtual ASTnode::ASTtype myType(void)

ovirtual bool isOfType( ASTtype T )

o

ovoid setTabFlag( bool setTo )

obool getTabFlag( void )

o Sets (or gets) the tabulation flag for this loop, and all nested loops inside it.
Sets (or gets) the tabulation flag for this loop, and all nested loops inside it. true = tab, 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.

ovoid setIndentFlag( bool setTo )

obool getIndentFlag( void ) const

o Sets (or gets) the boolean flag for whether or not to indent the values in this loop.
Sets (or gets) the boolean flag for whether or not to indent the values in this loop. When a loop is first constructed, the default is "true".

o LoopTableNode(const string &tflag, bool indentFl = true, int rowsPerLn = 1 )

o LoopTableNode( bool tflag )
call with tflag = true for "tabulate" or false for "linear"

o LoopTableNode( LoopIter& I)
Copy Constructor

o LoopTableNode( bool link, LoopIter& I)
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 Insertions/Deletions.
Insertions/Deletions. These cannot be done in exactly the same syntax as vector<> because we need to check for things that are illegal in STAR and disallow them. However, it should look quite familiar to someone who is fluent in the STL vector class.

obool insert( iterator pos, LoopRowNode &v )
	  * Insert - Insert before 'pos', the LoopRowNode given.  If the
	  *            LoopRowNode given has the wrong number of values, it
	  *            will fail and return false, else it returns true.
	  * 
	  * (This function makes a copy of the passed LoopRowNode, it does not use
	  * the passed LoopRowNode itself (in other words, you can delete
	  * it after calling (The LoopRowNode and the DataValueNodes IN the
	  * LoopRowNode).)
	  *
	  * This version makes a deep copy of the node given:

obool insert( iterator pos, LoopRowNode* v )
This version makes a link to the node given, so don't delete it afterword: (You are "giving" the new node to the class after having allocated it yourself)

obool insert( iterator pos, LoopTableNode &t )
	  * Insert - Insert before 'pos', the table of data given
	  *            by the LoopTableNode.  If the layout of values is not
	  *            consistent with the layout defined by the names
	  *            in the DataLoopNode, it will fail and return false,
	  *            else it returns true.
	  * 
(This function performs a DEEP COPY of the given loop node, so everything in the passed argument can be deleted after calling, if it is appropriate.)

obool insert( iterator pos, LoopTableNode* t )
This version makes a shallow link instead of a deep copy, so do not delete the node after passing it. (You are "giving" the node to the library, after having allocated it yourself.)

ovoid erase( iterator pos )
erase - Remove the row (LoopRowNode) given. If there is any nested table under it, it gets removed as well.

ovoid erase( iterator from, iterator to )
erase - Remove the range of rows given, using typical STL range conventions: The range is inclusive of the start, but exclusive of the end: [from,to)

o These types are used with the STL vector look-alike functions:
These types are used with the STL vector look-alike functions:

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

oList<int> * checkValueAlignment(void)
Test the Loop Table to see if there are any lines where the values on the line don't "align" with the names in the taglist. For a loop row to be "aligned", it must match the following criteria:
- If the loop is linear, then all rows are aligned no matter what.
- If the loop is tabular, then each LoopRowNode must have had all its values on the same text line in the original file for the loop to be aligned. (Exception: If any of the values in the LoopRowNode is a semicolon string, then give up on trying to check for alignment and assume the row is aligned.)

Notes:
- You need to delete the List returned when done with it. - The List returned will be of zero size if no misalignments were found. It never returns as NULL.

ovoid addValue(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

oASTlist<DataValueNode *> * returnLoopValues(unsigned position)
DEPRECIATED - use the STL vector operations instead

oStarFileNode::Status RemoveColumnValues( int nest, int ele )
DEPRECIATED - use the STL vector operations instead
(Removing the tagname from the name list with the erase() operator causes it to remove the values under that name)

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

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. This function MUST be overridden for each subclass of ASTnode.
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 )
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 value in all the lists: )

ovirtual void calcPrintSizes( List<int>** presizes, List<int>** postsizes )


This class has no child classes.
Friends:
class LoopRowNode
class LoopNameListNode
class DataLoopNameListNode
class DataLoopNode

Alphabetic index HTML hierarchy of classes or Java


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