Polaris: ProtoWrapper Class Reference

ProtoWrapper Class Reference

The base Wrapper class. More...

#include <ProtoWrapper.h>

Inheritance diagram for ProtoWrapper:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ProtoWrapper ()
virtual ~ProtoWrapper ()
void set (Listable *)
 Set the Listable object contained by the Wrapper.
Listableget () const
 Return the contained Listable object.
Listableobject () const
 Return the ProtoWrapper's object or report an error if invalid.
Listableobject_address () const
 Return the contained Listable object.
int valid () const
 Does this point to a valid object (not a Zombie)?
virtual int structures_OK ()

Protected Member Functions

void _object_errors () const
 performs p_asserts for object()
virtual int _is_proto_wrapper () const
 Is this wrapper a ProtoWrapper?

Protected Attributes

Listable_ptr
 Pointer to object.

Detailed Description

The base Wrapper class.

Polaris C++ VDL

See also:
ProtoWrapper.h

ProtoWrapper.cc

Overview

This is the base of the Wrapper classes and also functions as the stripped down version of a Wrapper containing only a pointer to the object. It is for use only by the Element class and should not be visible to any other classes.

Description

The Wrapper class is responsible for maintaining objects while in any Collection class. Wrappers perform all operations required for ownership indication, reference counting and for representing deleted objects in the form of Zombies.

The underlying formula for the Collection hierarchy is that Collections hold wrappers rather than the objects themselves. When an object is placed in a Collection, a new wrapper is created and the object is manipulated through the wrapper. The Listable class contributes a standardized interface to the Wrapper classes and the Collection hierarchy, and, thus, for an object to be contained by a wrapper, it must derive from Listable.

See Also

Wrapper, Listable

Definition at line 50 of file ProtoWrapper.h.


Constructor & Destructor Documentation

ProtoWrapper::ProtoWrapper  )  [inline]
 

Definition at line 85 of file ProtoWrapper.h.

References _ptr.

ProtoWrapper::~ProtoWrapper  )  [virtual]
 

... Nothing to do

Definition at line 11 of file ProtoWrapper.cc.


Member Function Documentation

void ProtoWrapper::_object_errors  )  const [protected]
 

performs p_asserts for object()

Definition at line 17 of file ProtoWrapper.cc.

References _ptr, and Listable::valid().

Referenced by object().

int ProtoWrapper::_is_proto_wrapper  )  const [protected, virtual]
 

Is this wrapper a ProtoWrapper?

Reimplemented in Wrapper.

Definition at line 27 of file ProtoWrapper.cc.

void ProtoWrapper::set Listable  )  [inline]
 

Set the Listable object contained by the Wrapper.

Definition at line 99 of file ProtoWrapper.h.

References _ptr.

Referenced by BaseElement::BaseElement(), BaseRefElement::BaseRefElement(), BaseRefElement::del(), BaseElement::del(), BaseRefElement::grab(), BaseElement::grab(), BaseRefElement::modify(), BaseElement::modify(), BaseRefElement::operator=(), BaseElement::operator=(), and BaseRefElement::~BaseRefElement().

Listable * ProtoWrapper::get  )  const [inline]
 

Return the contained Listable object.

Definition at line 105 of file ProtoWrapper.h.

References _ptr.

Referenced by BaseRefElement::del(), BaseElement::del(), BaseRefElement::grab(), BaseElement::grab(), BaseRefElement::member(), BaseElement::member(), BaseRefElement::modify(), BaseElement::modify(), BaseRefElement::modify_and_grab(), BaseElement::modify_and_grab(), BaseRefElement::operator *(), BaseElement::operator *(), BaseRefElement::operator->(), BaseElement::operator->(), BaseRefElement::print(), BaseElement::print(), BaseRefElement::valid(), BaseElement::valid(), BaseElement::~BaseElement(), and BaseRefElement::~BaseRefElement().

Listable * ProtoWrapper::object  )  const [inline]
 

Return the ProtoWrapper's object or report an error if invalid.

Reimplemented in LiveWrapper, RefWrapper, and Wrapper.

Definition at line 91 of file ProtoWrapper.h.

References _object_errors(), _ptr, and Listable::valid().

Referenced by Wrapper::object().

Listable * ProtoWrapper::object_address  )  const [inline]
 

Return the contained Listable object.

Definition at line 111 of file ProtoWrapper.h.

References _ptr.

Referenced by BaseList::assign(), BaseIter::assign(), Collection::clear(), BaseRefList::del(), Collection::index(), and Collection::valid().

int ProtoWrapper::valid  )  const [inline]
 

Does this point to a valid object (not a Zombie)?

Definition at line 117 of file ProtoWrapper.h.

References _ptr, and Listable::valid().

Referenced by Collection::clear(), BaseIter::current_invalid(), BaseIter::current_valid(), BaseMapRoot::find_ref(), BaseIter::grab(), BaseIter::modify_in_place(), Collection::operator[](), BaseIter::pull(), BaseMapRoot::remove(), Collection::structures_OK(), and Collection::valid().

int ProtoWrapper::structures_OK  )  [virtual]
 

Reimplemented in LiveWrapper, and RefWrapper.

Definition at line 34 of file ProtoWrapper.cc.

Referenced by Collection::structures_OK().


Member Data Documentation

Listable* ProtoWrapper::_ptr [protected]
 

Pointer to object.

Definition at line 52 of file ProtoWrapper.h.

Referenced by _object_errors(), RefWrapper::clone(), LiveWrapper::clone(), get(), object(), object_address(), ProtoWrapper(), set(), and valid().


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:08:01 2005