List Class Documentation


The List Design Philosophy

This group of classes are designed to be the abstract base class to represet the abstract concept of set or list. Also, these abstract classes enable iterators to navigate in different list representations without knowing the exact implementation of the list. Four concrete classes have been developed that drived from the abstract base class.

                           List
                            |
         -------------------------------------------
         |          |               |              |
    LinearList  NonLinearList  MultiLinearList   Array

More classes can be developed to represent wider range of List (or Set) representations, as long as the new classes can provide proper behaviors of ++, --, reset_to_top, reset_to_end, and copy_of_self.

Linear Lists

Represent a group of macromolecule components that posses a consecutive relationship in macromolecule structures.

    LinearList------------------->Element
                                     |
                                     | next
                                     V
                                  Element
                                     |
                                     | next
                                     V
                                  Element
                                     |
                                     | next
                                     V
                                   NULL

NonLinear Lists

Represent a set of macromolecule components that does not necessarily have consecutive relationships. For example:

  Functional Site-->SubEntityList-->DListSubEntity-------->S1
                                         |                  | next
                                         | next             V
                                         V                  S2
                                    DListSubEntity-->S7     | next
                                         |             |    V
                                         | next        V    S3
                                         V             S8
                                    DListSubEntity---------->S10
                                         |                      |
                                         | next                 V
                                         V                      .
                                    DListSubEntity-->S n        .
                                         |                      .
                                         | next
                                         V
                                    DListSubEntity-->S m
                                         |
                                         V
                                        NULL


Multi Linear Lists

Represent a set of macromolecule components that was comprised of multiple consecutive segments. For example:

  Sheet -->SubEntityList-->LinearSubEntityList
                              |
                              | next
                              V
                           LinearSubEntityEList
                              |
                              | next
                              V
                           LinearSubEntityList
                              |
                              | next
                              V
                             NULL



Class LinkListElement

/*********************************************************************
Class: LinkListElement

Method: LinkListElement()
Description: The basic singly linked list container class
This is the DEF CTOR, inits everything to 0.
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: LinkListElement

Method: LinkListElement(const LinkListElement& e)
Description: Shallow COPY CTOR of LinkListElement class
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: LinkListElement

Method: LinkListElement * Next()
Description: returns its _next member which points to the next
element in the Linked List
Usage:
Caution:
/*********************************************************************


Class DoubleLinkListElement

/*********************************************************************
Class: DoubleLinkListElement

Method: DoubleLinkListElement()
Description: Inherits from LinkListElement, and adds in a _previous
member to it to make it a doubly linked list container class
This is the DEF CTOR, inits everything to 0.
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: DoubleLinkListElement

Method: DoubleLinkListElement(DoubleLinkListElement& e)
Description: Shallow COPY CTOR of DoubleLinkListElement class.
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: DoubleLinkListElement

Method: DoubleLinkListElement * Previous()
Description: returns its _previous member
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: DoubleLinkListElement

Method: DoubleLinkListElement * Next()
Description: returns its _next member
Usage:
Caution:
/*********************************************************************


Class ListMgr

/*********************************************************************
Class: ListMgr

Method: ListMgr()
Description: DEF CTOR for the abstract base class. The ListMgr, is the
protocol class for all the lists. Linear,NonLiner and MultiLinear
ListMgr's inherit their interface, from it. They in turn redefine
most of ListMgr's member functions and operators.
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: ListMgr(const ListMgr & m)
Description: Shallow COPY CTOR for the ListMgr
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: operator const void * () const
Description: This is the cast operator, which tells a ListMgr object
how to cast itself into void *.
This is needed in the iterators, and is a good operator,
to use as a stopping condition. Basically it checks if the
current element is not 0.
Usage:
ListMgr old_list;
for(ListMgr lst(old_list); // The COPY CTOR is called here
lst; // The operator const void * is called on lst
lst++) { // operator++ called on lst.
...............
...............
...............
}
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: T & operator()()
Description: returns the current elements value
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: virtual void operator++()=0;
Description: sets its current element to be the next member of
its current element
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: virtual void operator--()=0;
Description: sets its current element to be the previous member of
its current element
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: virtual void ResetToTop()=0;
Description: resets to the Top of the list
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: virtual void ResetToEnd()=0;
Description: goes to the end of the list
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: virtual ListMgr *CopyOfSelf(int =0) const =0;
Description: returns a copy of itself. Just calls the copy ctor,
but since it is virtual, it calls the right copy ctor, for
all the derived classes
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: virtual void AddElement(T*)
Description: Adds an element to the list
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: virtual T* FindElement(char*)
Description: Finds an element in the list.
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: virtual void DeleteElement(T*)
Description: Deletes element from the list
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: ListMgr

Method: int Exist(T*);
Description: checks whether that element exists in the list
Usage:
Caution:
/*********************************************************************


Class LinearListMgr

/*********************************************************************
Class: LinearListMgr

Method: LinearListMgr()
Description: This is a linear list, which maintains a pointer to the
head and the tail of the list
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: LinearListMgr

Method: LinearListMgr(T * a1, T * a2 =0)
Description: sets the head to a1 and its tail to a2
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: LinearListMgr

Method: LinearListMgr(const LinearListMgr * l);
Description: sets its head and tail to l's head and tail
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: LinearListMgr

Method: void SetHead(const T& t)
Description: sets its head to point to t
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: LinearListMgr

Method: void SetTail(const T& t)
Description: sets its tail to point to t
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: LinearListMgr

Method: T* MyHead()
Description: returns its head
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: LinearListMgr

Method: T* MyTail()
Description: returns its tail
Usage:
Caution:
/*********************************************************************


Class NonLinearListMgr

/*********************************************************************
Class: NonLinearListMgr

Method: NonLinearListMgr()
Description: DEF CTOR for NonLinearListMgr. It maintains a head and
a current pointer's of type DoubleLinkListElement.
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: NonLinearListMgr

Method: NonLinearListMgr(const NonLinearListMgr *lp);
Description: Makes a shallow copy of lp. All it does is points to
lp's head and current DoubleLinkListElement.
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: NonLinearListMgr

Method: LinkListElement * MyList()
Description: returns its Head
Usage:
Caution:
/*********************************************************************


Class DLlistElementOfLinearListMgr

/*********************************************************************
Class: DLlistElementOfLinearListMgr

Method: DLlistElementOfLinearListMgr()
Description: This is a kind of container of a list of LinearListMgr
It maintains pointers to its linear list, and defines its
own next and previous ptrs.
Usage:
Caution:
/*********************************************************************


Class MultiLinearListMgr

/*********************************************************************
Class: MultiLinearListMgr

Method: MultiLinearListMgr()
Description: DEF CTOR for the MultiLinearListMgr. Maintains a list
of DLlistElementOfLinearListMgr. Also has a _current pointer
to the current DLlistElementOfLinearListMgr.
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: MultiLinearListMgr

Method: MultiLinearListMgr(const MultiLinearListMgr *l);
Description: Shallow COPY CTOR
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: MultiLinearListMgr

Method: virtual void AddLinearListMgr(LinearListMgr* l);
Description: Adds a Linear listMgr to its list
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: MultiLinearListMgr

Method: void Merge(MultiLinearListMgr*);
Description: Merges the 2 MultiLinearListMgr
Usage:
Caution:
/*********************************************************************


Class CollectionListMgr

/*********************************************************************
Class: CollectionListMgr

Method: CollectionListMgr(os_Collection *coll);
Description: creates a CollectionListMgr, out of an ObjectStore os_Collection
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: CollectionListMgr

Method: ListMgr *DeepCopyOfSelf();
Description: creates a deep copy of it self, and returns it
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: CollectionListMgr

Method: CollectionListMgr(int behavior=0,int expected_size=COLL_SIZE);
Description: This is the DEF CTOR for the CollectionListMgr. It creates
an empty os_collection.
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: CollectionListMgr

Method: CollectionListMgr(const CollectionListMgr *lp,int order=0);
Description: This is the COPY CTOR, which makes a shallow copy of the
collection
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: CollectionListMgr

Method: int MyCardinality() const
Description: returns the cardinality of the collection
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: CollectionListMgr

Method: void AddIndex(char *ix_path, int opt=os_index_path::ordered);
Description: Adds an index to the collection
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: CollectionListMgr

Method: CollectionListMgr *Query(char *query_str);
Description: Queries the collection, with query_str
Usage:
Caution:
/*********************************************************************
/*********************************************************************
Class: CollectionListMgr

Method: CollectionListMgr *Query(const os_bound_query &bnd_qry);
Description: Queries the collection with a bound query
Usage:
Caution:
/*********************************************************************

Back to The PDBlib


Back to The List Class


Currently under Heavy Construction, please excuse the mess


jcooper@cuhhca.hhmi.columbia.edu