class DataLoopNameListNode

This is a list of lists of names in a loop. The first list of names is the list of names for the outermost loop. the second list of names is the list of names for the next nesting level in, and so on.

Inheritance:


Public Methods

[more]StarFileNode::Status AddDataName (const string & name)
DEPRECIATED - use the STL vector notation instead:
[more]StarFileNode::Status ChangeName ( const string &oldName, const string &newName )
DEPRECIATED - use the STL vector notation instead:
[more]void FlattenNestedLoop (List<DataNameNode*>* L)
DEPRECIATED - use the STL vector notation instead:
[more]StarFileNode::Status RemoveDataName ( const string & name, int* nest = (int*)NULL, int* ele = (int*)NULL )
DEPRECIATED - use the STL vector notation instead:
[more]virtual void Unparse (int indent)
[more]const_reference back () const
[more]reference back ()
[more]const_iterator begin () const
[more]iterator begin ()
[more]void debugPrint ( void )
Print out debugging info detailing the layout of this list:
[more]bool empty () const
[more]iterator end ()
[more]const_iterator end () const
[more]void erase ( iterator pos )
erase - Remove the row of tagnames given.
[more]reference front ()
[more]const_reference front () const
[more]Status getNextTag (DataLoopValListNode::Status vstat, int & row)
DEPRECIATED - use the STL vector notation instead:
[more]bool insert ( iterator pos, LoopNameListNode &v )
Insert - Insert before 'pos', the LoopNameListNode given.
[more]bool insert ( iterator pos, LoopNameListNode* v )
Make a link to the node given (NOT A COPY - don't delete the node pointer that was passed)
[more]virtual bool isOfType ( ASTtype T )
[more]virtual int myLongestStr ( void )
Returns the length of the longest string in this object.
[more]string myName () const
Return the 'name' of this node (the name of the first tag in the outermost nesting level is arbitrarily chosen as the "name" of this node
[more]virtual ASTnode::ASTtype myType (void)
[more]reference operator[] ( size_type n )
[more]const_reference operator[] ( size_type n) const
[more]void reset ()
DEPRECIATED - use the STL vector notation instead:
[more]virtual List<ASTnode*> * searchByTag ( string &searchFor )
Given a tag name, find the AST object it 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]size_type size () const
[more]int tagPosition (const string & TagName)
DEPRECIATED - use tagPositionDeep instead
Get the index of the given tag, if it resides in the outermost loop only (is incapable of searching into nested tags) (This search is case-insensitive).
[more]void tagPositionDeep ( string tagName, int* nestLevel, int* column )
Get the index of the given name.
[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 ~DataLoopNameListNode ()
Destructor - recursively destroys the whole list of names

Public Members

[more]
[more] Insertions/Deletions.
[more]enum Status
class const_iterator
This is supposed to behave like the iterator class in an STL vector.
class iterator
This is supposed to behave like the iterator class in 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 void setParent( ASTnode* p )
ovirtual bool unlinkMe( void )

Public Members

oenum ASTtype

Protected Methods

ovoid printIndent(int indent)


Inherited from ASTnodeWithPosBits:


Documentation

This is a list of lists of names in a loop. The first list of names is the list of names for the outermost loop. the second list of names is the list of names for the next nesting level in, and so on.
oenum Status

o ERROR

o STOP

o NEW_ITER

o SAME_ITER

ovirtual ~DataLoopNameListNode()
Destructor - recursively destroys the whole list of names

ovoid debugPrint( void )
Print out debugging info detailing the layout of this list:

o

otypedef LoopNameListNode *value_type

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

o DataLoopNameListNode( DataLoopDefListNode &L)
Copy constructor with a deep recursive copy

o DataLoopNameListNode( bool link, DataLoopDefListNode &L)
Parallel copy constructor:

o DataLoopNameListNode(const DataLoopDefListNode& D)
Also a Copy Constructor

o DataLoopNameListNode(ASTlist<LoopDefListNode* >* L)

o DataLoopNameListNode()
Create an empty list of lists of names

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

o Insertions/Deletions.
Insertions/Deletions. Inserting new loop levels' names, and deleting a level of loop names.

Insert - Insert before 'pos', the row of tagnames given by 'v'. Note that what this means is that you are inserting a new nesting level to the loop. If this is already inside a DataLoopNode, then you are only allowed to add new nesting levels at the deepest level, i.e. 'pos' must == 'end()' or it will refuse to do it and return false. This is because if you inserted a new nesting level in the middle, then values that are at the levels deeper than that are no longer associated with the higher-level row that they are supposed to "hang" off from.

If this DataLoopNameListNode is not inside a DataLoopNode, then you can insert and remove nesting levels at will.

the passed vector itself (in other words, you can delete it after calling (and the DataNameNodes it points to).

obool insert( iterator pos, LoopNameListNode &v )
Insert - Insert before 'pos', the LoopNameListNode given.

(This function performs a DEEP copy of the given name def list so everything in the passed argument can be deleted after calling, if it is appropriate.)

obool insert( iterator pos, LoopNameListNode* v )
Make a link to the node given (NOT A COPY - don't delete the node pointer that was passed)

ovoid erase( iterator pos )
erase - Remove the row of tagnames given. If this is inside a DataLoopNode, then calling this method also removes all the values from the body of the loop that were associated with these names.

In order to keep the STAR syntax correct, deleting a row of names also results in all tagnames for levels nested AFTER that row being deleted also. (If there are three nested levels in a loop and you delete the middle level, then the inner level goes away too.)

That is why there is no erase() method for erasing a range of rows of names. There would be no point, seeing as how once one is deleted, the rest under it have to be deleted too.

ovirtual void Unparse(int indent)

ovirtual ASTnode::ASTtype myType(void)

ovirtual bool isOfType( ASTtype T )

oStarFileNode::Status AddDataName(const string & name)
DEPRECIATED - use the STL vector notation instead:

oStarFileNode::Status RemoveDataName( const string & name, int* nest = (int*)NULL, int* ele = (int*)NULL )
DEPRECIATED - use the STL vector notation instead:

oStarFileNode::Status ChangeName( const string &oldName, const string &newName )
DEPRECIATED - use the STL vector notation instead:

ovoid reset()
DEPRECIATED - use the STL vector notation instead:

oStatus getNextTag(DataLoopValListNode::Status vstat, int & row)
DEPRECIATED - use the STL vector notation instead:

ostring myName() const
Return the 'name' of this node (the name of the first tag in the outermost nesting level is arbitrarily chosen as the "name" of this node

ovoid FlattenNestedLoop(List<DataNameNode*>* L)
DEPRECIATED - use the STL vector notation instead:

oint tagPosition(const string & TagName)
DEPRECIATED - use tagPositionDeep instead
Get the index of the given tag, if it resides in the outermost loop only (is incapable of searching into nested tags) (This search is case-insensitive).
See Also:
tagPositionDeep

ovoid tagPositionDeep( string tagName, int* nestLevel, int* column )
Get the index of the given name. Returns the nest depth and the column index within that nest depth. (indexes start counting at zero, negative numbers returned mean the tag was not found.) The search is case-insensitive.

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 string as the tag 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 (not relevant at this scope )

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 takes the longest tagname from the name list)


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