class LoopNameListNode : public ASTnode

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

Inheritance:


Public Classes

class const_iterator
ASTlist <DataNameNode*> ::const_iterator vIter
const_iterator ()
const_iterator ( const ASTlist<DataNameNode*>::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)
class iterator
This is designed to behave like the STL vector iterator
ASTlist <DataNameNode*> ::iterator vIter
iterator ()
iterator ( const ASTlist<DataNameNode*>::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)

Public Methods

StarFileNode::Status AddDataName (const string & name)
DEPRECIATED - Use STL vector notation instead
bool atEnd ()
DEPRECIATED - Use STL vector notation instead
bool atStart ()
DEPRECIATED - Use STL vector notation instead
StarFileNode::Status ChangeName ( const string &oldName, const string &newName )
void debugPrint ( void )
Print out debugging info detailing the layout of this list:
void FlattenNestedLoop (List<DataNameNode*>* L)
DEPRECIATED
void getNextTag ()
DEPRECIATED - Use STL vector notation instead
int isInLoop (void)
isInLoop: Returns true if this LoopNameListNode is inside a DataLoopNode, or false if it is not
virtual bool isOfType ( ASTtype T )
virtual int myLongestStr ( void )
Returns the length of the longest string in this object
string myName () const
Return the name of the first tag in my list
virtual ASTnode::ASTtype myType (void)
StarFileNode::Status RemoveDataName (const string & name, int *ele = (int*)NULL )
DEPRECIATED - Use STL vector notation instead
void reset ()
DEPRECIATED - Use STL vector notation instead
virtual List <ASTnode*> * searchByTag ( string &searchFor )
Find the name given in this name list
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
int tagPosition (const string & tagName)
The postion of a tag in the list (returns an integer index)
virtual bool unlinkChild ( ASTnode *child )
unlinks the given ASTnode from this ASTnode, assuming that the given ASTnode is a child of this ASTnode
virtual void Unparse (int indent)
virtual ~LoopNameListNode ()
Destructor

Public



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
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
size_type size () const
bool empty () const
reference operator[] ( size_type n )
const_reference operator[] ( size_type n) const
reference front ()
const_reference back () const
const_reference front () const
reference back ()


The following functions are all designed to make sure things stay correct within the STAR file rules
void insert ( iterator pos, DataNameNode &v )
This version copies the DataNameNode into the list:
void 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):
void insert ( iterator pos, DataNameNode &v, DataValueNode &val )
This version allows the caller to specify the value to insert: Make-a-copy of DataNameNode version:
void insert ( iterator pos, DataNameNode *v, DataValueNode &val )
This version allows the caller to specify the value to insert: Make-a-link of DataNameNode version:
void erase ( iterator pos )
erase - Remove the value given
void erase ( iterator from, iterator to )
erase - Remove the values in the range given as [from,to)

typedef DataNameNode* 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

LoopNameListNode ( LoopNameListNode &L)
Deep-Copy Constructor
LoopNameListNode ( bool link, LoopNameListNode &L)
Copy with parallel link
LoopNameListNode (ASTlist<DataNameNode *> *L)
LoopNameListNode (vector<DataNameNode *> &L)
LoopNameListNode ()
Makes an empty list:

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 ASTnode* myParent(void)
bool NotVirtualIsOfType( ASTtype T )
virtual bool removeChild( ASTnode *child )
virtual bool removeMe( void )
virtual void setParent( ASTnode *p )
virtual size_t sizeOfMe(void)
virtual bool unlinkMe( void )

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.

LoopNameListNode( LoopNameListNode &L)
Deep-Copy Constructor

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.

LoopNameListNode(ASTlist<DataNameNode *> *L)

LoopNameListNode(vector<DataNameNode *> &L)

LoopNameListNode()
Makes an empty list:

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

typedef DataNameNode* 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

class iterator
This is designed to behave like the STL vector iterator. it is not documented in detail because the reader is expected to have access to the STL documentation descrtibing vectors. Note that reverse_iterator and const_reverse_iterator are not implemented.

ASTlist <DataNameNode*> ::iterator vIter

iterator()

iterator( const ASTlist<DataNameNode*>::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)

class const_iterator

ASTlist <DataNameNode*> ::const_iterator vIter

const_iterator()

const_iterator( const ASTlist<DataNameNode*>::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)

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

iterator begin()

iterator end()

const_iterator begin() const

const_iterator end() const

size_type size() const

bool empty() const

reference operator[]( size_type n )

const_reference operator[]( size_type n) const

reference front()

const_reference back() const

const_reference front() const

reference back()

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

void insert( iterator pos, DataNameNode &v )
This version copies the DataNameNode into the list:

void 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):

void insert( iterator pos, DataNameNode &v, DataValueNode &val )
This version allows the caller to specify the value to insert: Make-a-copy of DataNameNode version:

void insert( iterator pos, DataNameNode *v, DataValueNode &val )
This version allows the caller to specify the value to insert: Make-a-link of DataNameNode version:

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

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

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

virtual ~LoopNameListNode()
Destructor

virtual void Unparse(int indent)

virtual ASTnode::ASTtype myType(void)

virtual bool isOfType( ASTtype T )

void reset()
DEPRECIATED - Use STL vector notation instead

void getNextTag()
DEPRECIATED - Use STL vector notation instead

bool atEnd()
DEPRECIATED - Use STL vector notation instead

bool atStart()
DEPRECIATED - Use STL vector notation instead

string 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

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

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

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

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

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

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

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
Parameters:
type - type to search for
delim - the delimiter type (not relevant for this scope).

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.

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


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++