class LoopNameListNode

A list of tag names representing one single nesting level of a loop's definition.

Inheritance:


Public Methods

[more]StarFileNode::Status AddDataName (const string & name)
DEPRECIATED - Use STL vector notation instead
[more]StarFileNode::Status ChangeName ( const string &oldName, const string &newName )
[more]void FlattenNestedLoop (List<DataNameNode*>* L)
DEPRECIATED
[more]StarFileNode::Status RemoveDataName (const string & name, int* ele = (int*)NULL )
DEPRECIATED - Use STL vector notation instead
[more]virtual void Unparse (int indent)
[more]bool atEnd ()
DEPRECIATED - Use STL vector notation instead
[more]bool atStart ()
DEPRECIATED - Use STL vector notation instead
[more]void debugPrint ( void )
Print out debugging info detailing the layout of this list:
[more]void getNextTag ()
DEPRECIATED - Use STL vector notation instead
[more]int isInLoop (void)
isInLoop: Returns true if this LoopNameListNode 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]string myName () const
Return the name of the first tag in my list.
[more]virtual ASTnode::ASTtype myType (void)
[more]void reset ()
DEPRECIATED - Use STL vector notation instead
[more]virtual List<ASTnode*> * searchByTag ( string &searchFor )
Find the name given in this name list.
[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]int tagPosition (const string & tagName)
The postion of a tag in the list (returns an integer index).
[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 ~LoopNameListNode ()
Destructor

Public Members

[more]
class const_iterator
class iterator
This is designed to behave like the STL vector iterator.


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

A list of tag names representing one single nesting level of a loop's definition. This class is designed to look somewhat like an STL vector, implementing many of the same methods as STL vector. The caller is not given access to the interior ASTlist of names because there needs to be some automated sanity checking to prevent people from deleting names without deleting the associated values in the loop. The same is true for inserting new names. If a new name is inserted, new values need to be inserted into the associated loop's values so the result is still valid STAR syntax. The methods in this class that are made to look like STL vector functions perform these tasks automatically when things are inserted or deleted from the list of names.
ovoid debugPrint( void )
Print out debugging info detailing the layout of this list:

o

o The following functions are all designed to make sure things stay correct within the STAR file rules.
The following functions are all designed to make sure things stay correct within the STAR file rules. Thus they automatically insert and delete the appropriate data values to go along with the data names if this LoopNameListNode is inside a DataLoopNode.

If this LoopNameListNode has not yet been attached to the rest of a DataLoopNode yet, such that there are no associated data values to go with these names, then nothing special happens - the name(s) is(are) inserted and that's all.

Here is the more precise rules:
-------------------------------

  • Any time any new tagnames are INSERTED:
    • If this LoopNameListNode is inside a DataLoopNode:
      • If that DataLoopNode has any rows of values at the nesting level where this inserted name is going in:
        • For each such row, a new DataValueNode is inserted under this new tag name. The value is STAR-null (a period), or some other constant value provided by the caller of the insert function.

  • Any time any new tagnames are DELETED:
    • If this LoopNameListNode is inside a DataLoopNode:
      • If that DataLoopNode has any rows of values at the nesting level where this inserted name is going in:
        • For each such row, the DataValueNodes associated with the name(s) that is(are) deleted are also deleted so the loop is still syntacticly correct.

Insert - Insert before 'pos', the Name given. All versions make copies of the Name rather than just pointers to it:

When new values need to be inserted to go with the new name, this version defaults the values to insert to the STAR-null value, a single nonquoted dot (.):

ovoid insert( iterator pos, DataNameNode* v )
This version makes a link to the DataNameNode in the list: (Don't delete the DataNameNode after you call this):

ovoid insert( iterator pos, DataNameNode &v, DataValueNode &val )
This version allows the caller to specify the value to insert:

Make-a-copy of DataNameNode version:

ovoid insert( iterator pos, DataNameNode* v, DataValueNode &val )
This version allows the caller to specify the value to insert:

Make-a-link of DataNameNode version:

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

ovoid erase( iterator from, iterator to )
erase - Remove the values in the range given as [from,to)

o These are for use with STL iterator algorithms: The following allows the caller to use LoopNameListNode like it was an STL vector, with the extra stipulation that deletion or insertion operations will automatically cause the values in the same loop to be altered so that the loop is still valid STAR syntax.
These are for use with STL iterator algorithms: The following allows the caller to use LoopNameListNode like it was an STL vector, with the extra stipulation that deletion or insertion operations will automatically cause the values in the same loop to be altered so that the loop is still valid STAR syntax. (Values added or deleted as appropriate.)

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

otypedef DataNameNode *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 LoopNameListNode( LoopNameListNode &L)
Deep-Copy Constructor

o LoopNameListNode( bool link, LoopNameListNode &L)
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 LoopNameListNode(ASTlist<DataNameNode* >* L)

o LoopNameListNode(vector<DataNameNode* > &L)

o LoopNameListNode()
Makes an empty list:

oint isInLoop(void)
isInLoop: Returns true if this LoopNameListNode 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 LoopNameListNode 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.

ovirtual ~LoopNameListNode()
Destructor

ovirtual void Unparse(int indent)

ovirtual ASTnode::ASTtype myType(void)

ovirtual bool isOfType( ASTtype T )

ovoid reset()
DEPRECIATED - Use STL vector notation instead

ovoid getNextTag()
DEPRECIATED - Use STL vector notation instead

obool atEnd()
DEPRECIATED - Use STL vector notation instead

obool atStart()
DEPRECIATED - Use STL vector notation instead

ostring myName() const
Return the name of the first tag in my list. By convention, that will be my "name" for the purposes of those methods that insist that everything in the tree have a name

ovoid FlattenNestedLoop(List<DataNameNode*>* L)
DEPRECIATED

oint tagPosition(const string & tagName)
The postion of a tag in the list (returns an integer index). The return value starts counting at zero, like arrays do. (A negative number indicates it was not found.) Note that this is a case-insensitive search. A tag of "_tag1" will count as a match when searching for "_TAG1" or "_Tag1".

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

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

oStarFileNode::Status ChangeName( const string &oldName, const string &newName )

ovirtual List<ASTnode*> * searchByTag( string &searchFor )
Find the name given in this name list.

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.

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:
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 for 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 returns the longest tag name in the list of names.)


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