Polaris: LiveWrapper Class Reference

LiveWrapper Class Reference

#include <LiveWrapper.h>

Inheritance diagram for LiveWrapper:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 LiveWrapper ()
virtual ~LiveWrapper ()
virtual Listableobject () const
 Return the Wrapper\'s object or report an error if invalid.
virtual void object (const Listable *newobject)
 Set Wrapper\'s object to newobject and delete the old object if one exists.
void loose_object ()
 LiveWrapper will no longer have an object (possibly grabbed) Remove object, but do not delete it.
virtual void delete_object ()
 Delete object or Zombie it if it has outstanding refs.
void zombie_object ()
 Zombie the object.
Listablemodify_and_grab (Listable *newobject)
 Set Wrapper\'s object to newobject and return the old object newobject must not already be in a list.
void modify_in_place (modify_proc mod, void *extra_data=0)
 Modify the object in place by calling mod(obj, extra_data) where obj is the pointer which owns the object.
virtual int is_live_wrapper () const
 Is wrapper a live wrapper a reference wrapper?
virtual Wrapperclone () const
 Return a copy of the wrapper and possibly the object.
virtual int structures_OK ()

Constructor & Destructor Documentation

LiveWrapper::LiveWrapper  )  [inline]
 

Definition at line 61 of file LiveWrapper.h.

LiveWrapper::~LiveWrapper  )  [virtual]
 

... Nothing to do.

Definition at line 27 of file LiveWrapper.cc.


Member Function Documentation

Listable * LiveWrapper::object  )  const [virtual]
 

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

Reimplemented from Wrapper.

Definition at line 33 of file LiveWrapper.cc.

References Wrapper::object().

Referenced by BaseMap::_list_insert(), clone(), and BaseList::modify().

void LiveWrapper::object const Listable newobject  )  [virtual]
 

Set Wrapper\'s object to newobject and delete the old object if one exists.

This also sets newobject's parent pointer and possibly updates the reference count. newobject must not already be in a list

Reimplemented from Wrapper.

Definition at line 39 of file LiveWrapper.cc.

References dec_refs_delete_or_zombie(), delete_object(), Listable::in_collection(), Listable::ref_inc(), Wrapper::ref_inc(), and Listable::wrapper().

void LiveWrapper::loose_object  ) 
 

LiveWrapper will no longer have an object (possibly grabbed) Remove object, but do not delete it.

... we no longer point to it (but don't delete ... it by accident)

... It is no longer in a collection

... it no longer points to us

Definition at line 75 of file LiveWrapper.cc.

References Listable::in_collection(), Wrapper::ref_dec(), Listable::ref_remove(), and Listable::wrapper().

Referenced by BaseList::grab(), and BaseList::pull().

void LiveWrapper::delete_object  )  [virtual]
 

Delete object or Zombie it if it has outstanding refs.

This also updates references from/to the object.

Reimplemented from Wrapper.

Definition at line 91 of file LiveWrapper.cc.

References dec_refs_delete_or_zombie(), Wrapper::ref_dec(), and Listable::wrapper().

Referenced by BaseList::del(), and object().

void LiveWrapper::zombie_object  )  [inline]
 

Zombie the object.

< Zombie *undead = new(_ptr) Zombie;

Definition at line 68 of file LiveWrapper.h.

References Listable::_flags, and packed_object::_refs.

Listable * LiveWrapper::modify_and_grab Listable newobject  ) 
 

Set Wrapper\'s object to newobject and return the old object newobject must not already be in a list.

... holder no longer refed or in collection ... (call remove so don't accidentally delete)

... newobject now refed in collection

Definition at line 121 of file LiveWrapper.cc.

References Listable::in_collection(), Listable::ref_inc(), Listable::ref_remove(), and Listable::wrapper().

Referenced by BaseList::modify_and_grab().

void LiveWrapper::modify_in_place modify_proc  mod,
void *  extra_data = 0
 

Modify the object in place by calling mod(obj, extra_data) where obj is the pointer which owns the object.

The procedure 'mod' is expected to do it's own grabage collection as seen in Simplify.

int LiveWrapper::is_live_wrapper  )  const [virtual]
 

Is wrapper a live wrapper a reference wrapper?

Reimplemented from Wrapper.

Definition at line 146 of file LiveWrapper.cc.

Wrapper * LiveWrapper::clone  )  const [virtual]
 

Return a copy of the wrapper and possibly the object.

Reimplemented from Wrapper.

Definition at line 152 of file LiveWrapper.cc.

References Wrapper::_next, Wrapper::_prev, ProtoWrapper::_ptr, Wrapper::_refs, Listable::in_collection(), Listable::listable_clone(), object(), and Listable::valid().

int LiveWrapper::structures_OK  )  [virtual]
 

Reimplemented from ProtoWrapper.

Definition at line 172 of file LiveWrapper.cc.

References Listable::in_collection(), and Listable::wrapper().


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:46 2005