BaseRefList Class ReferenceA class to create BaseRefLists of Listable objects.
More...
#include <BaseRefList.h>
Inheritance diagram for BaseRefList:
[legend]List of all members.
|
Public Member Functions |
| void | _del (RefWrapper *ref) |
| | This function is used by TypedBaseRefMap<S,T> so it made public.
|
| | BaseRefList () |
| | BaseRefList (const BaseRefList &l) |
| virtual | ~BaseRefList () |
| void | print (ostream &out, char *sep) const |
| | print list to out with 'sep' sepperating each element
|
| void | modify (int loc, Listable &el) |
| | change the reference at loc to a reference to el.
|
| void | ins (const Listable &new_element, int loc) |
| | Insert new_element at location loc, where 0 <= loc <= entries().
|
| void | del (Listable &el, int loc) |
| | Delete node 'el' if on or after locth position.
|
| virtual void | del (int loc) |
| | Random Access Delete.
|
| void | ins_before (const Listable &new_element, const Listable &ref) |
| | Insert new_element before the reference element 'ref' (if ref == 0, insert at END of list).
|
| void | ins_after (const Listable &new_element, const Listable &ref) |
| | Insert new_element after the reference element 'ref' (if ref == 0, insert at BEGINNING of list).
|
| BaseRefList & | operator= (const BaseRefList &l) |
| | Copy operator copies all valid references.
|
Protected Member Functions |
| RefWrapper * | _find_wrapper (const Listable &el) |
| RefWrapper * | _find_wrapper (int loc) |
| void | _ins_before (const Listable &el, const RefWrapper *ref, char *method) |
Friends |
| class | BaseRefMap |
| ostream & | operator<< (ostream &o, const BaseRefList &l) |
Detailed Description
A class to create BaseRefLists of Listable objects.
Polaris C++ VDL - See also:
- BaseRefList.h
BaseRefList.h
BaseRefList.cc
The BaseRefList class creates the underlying structure for reflists for the type 'obj' which must be derived from Listable. Since the BaseRefList is derived from Collection it works with Iterators. For an object to be placed into a RefList it must have already been placed in an ownership structure like a List, Map or element. This class is not meant to be used directly but is used to build usable structures like RefList and RefSet.
The BaseRefList supports all of the functionality of the structures intended for use by the public, however, since the class is not templatized, it cannot provide all of the error checking facilities which may be desired. Although, all functionality herein is duplicated in the final classes, it is still described here:
All objects in a RefList must exist in some other live structure. If this is not the case, an error is raised upon insertion. If the live object is removed from its owner-structure, references to it within the RefList will become invalid.
BaseRefList is subject to the restrictions of the Iterators--that is, when a wrapper is taken out of the BaseRefList, only the pointers of the neighboring wrappers are changed--the out-going pointers are maintained (ie, _unlink_wrapper is called).
It is possible to have more than one reference to a single object within a BaseRefList. This could cause confusion in terms of how the methods behave. If an object (it's address) is used as a reference point for a method and more than one exist, the first one encountered will be operated on.
Final collections do not actually inherit from BaseRefList. Instead the final collections simply contain BaseRefLists. The hierarchy can be represented by:
.BUGS Currently, RefLists are not equipped to be static.
Collection, Listable, RefWrapper, Iterator, TypedCollection, Zombie, RefList, RefSet
Definition at line 114 of file BaseRefList.h.
Constructor & Destructor Documentation
| BaseRefList::BaseRefList |
( |
|
) |
[inline] |
|
Member Function Documentation
| RefWrapper * BaseRefList::_find_wrapper |
( |
int |
loc |
) |
[protected] |
|
| void BaseRefList::_ins_before |
( |
const Listable & |
el, |
|
|
const RefWrapper * |
ref, |
|
|
char * |
method |
|
) |
[protected] |
|
| void BaseRefList::print |
( |
ostream & |
out, |
|
|
char * |
sep |
|
) |
const [virtual] |
|
| void BaseRefList::modify |
( |
int |
loc, |
|
|
Listable & |
el |
|
) |
[inline] |
|
| void BaseRefList::ins |
( |
const Listable & |
new_element, |
|
|
int |
loc |
|
) |
|
|
| void BaseRefList::del |
( |
Listable & |
el, |
|
|
int |
loc |
|
) |
|
|
| void BaseRefList::del |
( |
int |
loc |
) |
[virtual] |
|
| void BaseRefList::ins_before |
( |
const Listable & |
new_element, |
|
|
const Listable & |
ref |
|
) |
[inline] |
|
| void BaseRefList::ins_after |
( |
const Listable & |
new_element, |
|
|
const Listable & |
ref |
|
) |
|
|
Friends And Related Function Documentation
| ostream& operator<< |
( |
ostream & |
o, |
|
|
const BaseRefList & |
l |
|
) |
[friend] |
|
The documentation for this class was generated from the following files:
|