class LoopRowNode : public ASTnode

This class is a single row of values in a loop

Inheritance:


Public Fields

LoopTableNode* innerLoop
bool myTflag
private : ASTlist <DataValueNode *> myVals

Public Methods

void addInnerLoopValue (const DataLoopNameListNode::Status dstat, const int row, const int currRow, DataValueNode *value)
DEPRECIATED - use the STL vector operations instead.
void addValue (DataValueNode *value)
DEPRECIATED - use the STL vector operations instead.
void FlattenNestedLoop (List<DataValueNode*>* M)
DEPRECIATED - use the STL vector operations instead.
StarFileNode::Status LoopRowNode::RemoveColumnValues ( int nest, int ele )
DEPRECIATED - use the STL vector operations instead.
virtual int myLongestStr ( void )
Returns the length of the longest string in this object
void reset ()
DEPRECIATED - use the STL vector operations instead.
DataValueNode* returnLoopValue (unsigned position)
DEPRECIATED - use the STL vector operations instead.
DataLoopValListNode::Status returnNextLoopElement (DataValueNode* & v)
DEPRECIATED - use the STL vector operations instead.
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
virtual bool unlinkChild ( ASTnode *child )
unlinks the given ASTnode from this ASTnode, assuming that the given ASTnode is a child of this ASTnode

Public


void setTabFlag ( bool setTo )
bool getTabFlag ( void )

Sets (or gets) the tabulation flag for this row, and all nested loops inside it

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 bool isOfType( ASTtype T )
virtual ASTnode* myParent(void)
virtual ASTtype myType(void)
bool NotVirtualIsOfType( ASTtype T )
virtual bool removeChild( ASTnode *child )
virtual bool removeMe( void )
virtual List <ASTnode*> * searchByTag( string &searchFor)
virtual List <ASTnode*> * searchByTag( char *searchFor)
virtual void setParent( ASTnode *p )
virtual size_t sizeOfMe(void)
virtual bool unlinkMe( void )
virtual void Unparse(int indent)

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.

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

typedef DataValueNode* value_type

typedef value_type* pointer

typedef const value_type* const_pointer

typedef value_type& reference

typedef const value_type& const_reference

typedef size_t size_type

typedef size_t difference_type

ASTlist <DataValueNode*> ::iterator vIter

iterator()

iterator( const ASTlist<DataValueNode*>::iterator ©Me )

iterator( value_type ©Me )

~iterator()

bool operator==( const iterator &x ) const

bool operator!=( const iterator &x ) const

reference operator*() const

value_type operator->() const

iterator& operator++()

iterator& operator++(int)

iterator& operator--()

iterator& operator--(int)

iterator& operator+=(size_type n)

iterator& operator-=(size_type n)

ASTlist <DataValueNode*> ::const_iterator vIter

const_iterator()

const_iterator( const ASTlist<DataValueNode*>::const_iterator ©Me )

const_iterator( const value_type ©Me )

~const_iterator()

bool operator==( const iterator &x ) const

bool operator!=( const iterator &x ) const

const_reference operator*() const

const value_type operator->() const

const_iterator& operator++()

const_iterator& operator++(int)

const_iterator& operator--()

const_iterator& operator--(int)

const_iterator& operator+=(size_type n)

const_iterator& operator-=(size_type n)

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

bool insert( iterator pos, DataValueNode &v )
This allocates a copy of the data, rather than a pointer to it, so if the caller is passing a heap-allocated DataValueNode, the caller needs to delete it later

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

bool erase( iterator pos )
erase - Remove the value given.

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

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

LoopRowNode( IterNode& N)
Copy Constructor.

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.

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

void addValue(DataValueNode *value)
DEPRECIATED - use the STL vector operations instead.

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

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

void reset()
DEPRECIATED - use the STL vector operations instead.

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

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

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

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.

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

void setTabFlag( bool setTo )

bool getTabFlag( void )

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

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. This function MUST be overridden for each subclass of ASTnode.

private : ASTlist <DataValueNode *> myVals

LoopTableNode* innerLoop

bool myTflag

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

alphabetic index hierarchy of classes


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

generated by doc++