Polaris: BaseMap Class Reference

BaseMap Class Reference

Link between Collection and Maps. More...

#include <BaseMap.h>

Inheritance diagram for BaseMap:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 BaseMap ()
virtual ~BaseMap ()

Protected Member Functions

virtual void _list_insert (BMNode *z, Listable *new_data)
 Insert new_data into the internal list.
virtual INLINE void _insert_before (Wrapper *new_elem, Wrapper *old_elem)
virtual INLINE void _insert_after (Wrapper *new_elem, Wrapper *old_elem)
 insert new_elem into the internal list, given the wrappers

Protected Attributes

BaseList _data_list
 List of actual data objects.

Friends

ostream & operator<< (ostream &o, const BaseMap &map)

Detailed Description

Link between Collection and Maps.

Polaris C++ VDL

See also:

BaseMap.h

BaseMap.cc

Overview

BaseMap is an abstract base class for a map of keys to objects of type Listable. The internal tree structure is implemented in the class BaseMapRoot which is inherited by BaseMap. BaseMap adds to the tree structure by including a list structure derived from Collection which allows all Collection-related functions such as reference counting and ownership-indication to be done by Maps and Databases.

BaseMap is part of the base of a wide variety of Maps and Databases with full functionality, however, this class can not be used on its own. Derived classes can be used as follows:

    1.  The pure virtual functions _kill_key, _less, _equal and _print have
        been defined in the class derived from BaseMap.

Hierarchy Structure

BaseMap acts as the link between the Collection hierarchy and the Map/Database hierarchy. The hierarchy can be modeled as follows:

                        --- :    inherited from relationship
                        -c- :    contained in relationship
   
   
                            Collection
                           /          \                                          //
                          /            \                                         //
                  BaseList   Listable   BaseRefList
                  |  \          |             /  |
                  |   \         |            /   |
                  |    c  TypedCollection   c    |
                  |     \     /     \      /     |
                  |      \   /       \    /      |
                  |      LIST        RefList     |
                  |      Set         RefSet      |
                  c                              c
                  |          Listable            |
                  |             |                |
                  |             |                |
                  |        BaseMapRoot           |
                  |       /           \          |
                  |      /             \         |
                  BaseMap               BaseRefMap
                     |                       |
                     |                       |                            
                TypedBaseMap          TypedBaseRefMap
                  /     \                /         \                             //
                 /       \              /           \                            //
       ProtoDatabase      ProtoMap   ProtoRefMap    ProtoRefDatabase
            /  \           |    |      |     |         |         \               //
           /    \          |    |      |     |         |          \              //
    Database KeyDatabase  Map KeyMap  RefMap KeyMap  RefDatabase RefKeyDatabase

See Also

BaseMapRoot, Listable, BaseList

Definition at line 88 of file BaseMap.h.


Constructor & Destructor Documentation

BaseMap::BaseMap  )  [inline]
 

< Nothing to do

Definition at line 111 of file BaseMap.h.

BaseMap::~BaseMap  )  [virtual]
 

Definition at line 62 of file BaseMap.cc.


Member Function Documentation

void BaseMap::_list_insert BMNode z,
Listable new_data
[protected, virtual]
 

Insert new_data into the internal list.

Set z's _data field to point to new_data's wrapper.

Implements BaseMapRoot.

Definition at line 18 of file BaseMap.cc.

References _data_list, Collection::_entries, Collection::_first, Collection::_last, BaseMapRoot::entries(), LiveKeyWrapper::key_node(), Wrapper::next(), Wrapper::next_ref(), LiveWrapper::object(), Wrapper::prev(), Wrapper::ref_dec(), and Wrapper::ref_inc().

INLINE void BaseMap::_insert_before Wrapper new_elem,
Wrapper old_elem
[protected, virtual]
 

< new first gains ref

Definition at line 120 of file BaseMap.h.

References _data_list, Collection::_entries, Collection::_first, Wrapper::next_ref(), Wrapper::prev(), Wrapper::ref_dec(), and Wrapper::ref_inc().

INLINE void BaseMap::_insert_after Wrapper new_elem,
Wrapper old_elem
[protected, virtual]
 

insert new_elem into the internal list, given the wrappers

needed for ordered collections.

Definition at line 138 of file BaseMap.h.

References _data_list, Collection::_entries, Collection::_last, Wrapper::next(), BaseList::next_ref(), Wrapper::prev_ref(), Wrapper::ref_dec(), and Wrapper::ref_inc().


Friends And Related Function Documentation

ostream& operator<< ostream &  o,
const BaseMap map
[friend]
 

Definition at line 11 of file BaseMap.cc.


Member Data Documentation

BaseList BaseMap::_data_list [protected]
 

List of actual data objects.

Definition at line 91 of file BaseMap.h.

Referenced by _insert_after(), _insert_before(), and _list_insert().


The documentation for this class was generated from the following files:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:07:00 2005