class DataLoopNameListNode : public ASTnode

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 Classes

class const_iterator
This is supposed to behave like the iterator class in an STL vector
ASTlist <LoopNameListNode*> ::const_iterator vIter
const_iterator ()
const_iterator ( const ASTlist<LoopNameListNode*>::const_iterator ©Me )
const_iterator ( const value_type ©Me )
~const_iterator ()
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 supposed to behave like the iterator class in an STL vector
ASTlist <LoopNameListNode*> ::iterator vIter
iterator ()
iterator ( const ASTlist<LoopNameListNode*>::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)
enum Status
ERROR
STOP
NEW_ITER
SAME_ITER

Public Methods

StarFileNode::Status AddDataName (const string & name)
DEPRECIATED - use the STL vector notation instead:
reference back ()
const_reference back () const
iterator begin ()
const_iterator begin () const
StarFileNode::Status ChangeName ( const string &oldName, const string &newName )
DEPRECIATED - use the STL vector notation instead:
void debugPrint ( void )
Print out debugging info detailing the layout of this list:
bool empty () const
const_iterator end () const
iterator end ()
void FlattenNestedLoop (List<DataNameNode*>* L)
DEPRECIATED - use the STL vector notation instead:
reference front ()
const_reference front () const
Status getNextTag (DataLoopValListNode::Status vstat, int & row)
DEPRECIATED - use the STL vector notation instead:
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 this node (the name of the first tag in the outermost nesting level is arbitrarily chosen as the "name" of this node
virtual ASTnode::ASTtype myType (void)
reference operator[] ( size_type n )
const_reference operator[] ( size_type n) const
StarFileNode::Status RemoveDataName ( const string & name, int *nest = (int*)NULL, int *ele = (int*)NULL )
DEPRECIATED - use the STL vector notation instead:
void reset ()
DEPRECIATED - use the STL vector notation instead:
virtual List <ASTnode*> * searchByTag ( string &searchFor )
Given a tag name, find the AST object it resides in
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
size_type size () const
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
void tagPositionDeep ( string tagName, int *nestLevel, int *column )
Get the index of the given name
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 ~DataLoopNameListNode ()
Destructor - recursively destroys the whole list of names.

Public


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


Insertions/Deletions
bool insert ( iterator pos, vector<DataNameNode*> &v )
Make a copy of the vector version:
bool insert ( iterator pos, LoopNameListNode &v )
Insert - Insert before 'pos', the LoopNameListNode given
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)
void erase ( iterator pos )
erase - Remove the row of tagnames given

DataLoopNameListNode ( DataLoopDefListNode &L)
Copy constructor with a deep recursive copy
DataLoopNameListNode ( bool link, DataLoopDefListNode &L)
Parallel copy constructor:
DataLoopNameListNode (const DataLoopDefListNode& D)
Also a Copy Constructor.
DataLoopNameListNode (ASTlist<LoopDefListNode *> *L)
DataLoopNameListNode ()
Create an empty list of lists of names.

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

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.
enum Status

ERROR

STOP

NEW_ITER

SAME_ITER

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

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

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

DataLoopNameListNode(ASTlist<LoopDefListNode *> *L)

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

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

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

typedef LoopNameListNode* 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 supposed to behave like the iterator class in an STL vector. It is not documented because the reader is expected to have access to the STL vector documentation, and a treatise on how to use STL vectors is beyond the scope of this documentation. Note that reverse_iterator and const_reverse_iterator are not implemented.

ASTlist <LoopNameListNode*> ::iterator vIter

iterator()

iterator( const ASTlist<LoopNameListNode*>::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
This is supposed to behave like the iterator class in an STL vector. It is not documented because the reader is expected to have access to the STL vector documentation, and a treatise on how to use STL vectors is beyond the scope of this documentation. Note that reverse_iterator and const_reverse_iterator are not implemented.

ASTlist <LoopNameListNode*> ::const_iterator vIter

const_iterator()

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

const_iterator( const value_type ©Me )

~const_iterator()

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)

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

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

bool insert( iterator pos, vector<DataNameNode*> &v )
Make a copy of the vector version:

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

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)

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

virtual void Unparse(int indent)

virtual ASTnode::ASTtype myType(void)

virtual bool isOfType( ASTtype T )

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

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

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

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

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

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

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

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).
See Also:
tagPositionDeep

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

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

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 at 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 takes the longest tagname from the name 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++