Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

ph::common::composite_object_base Class Reference

#include <composition_object.hpp>

Inheritance diagram for ph::common::composite_object_base:

ph::common::composition_object_base persist_test::c_base reflect_test::c_base persist_test::c_ref persist_test::c_vector reflect_test::c_ref reflect_test::c_vector

Detailed Description

Abstract class representing a composite object.

This class is the "Composite" in the "Composite" pattern.

Definition at line 34 of file composition_object.hpp.

Public Member Functions

virtual bool add (object_base *obj, bool owned)=0
virtual bool remove (object_base *obj)=0
virtual bool owned () const
virtual void owned (bool owned)
virtual bool singleton () const =0
virtual int count () const =0
virtual composite_object_basecomposite ()
virtual const composite_object_basecomposite () const


Member Function Documentation

virtual bool ph::common::composite_object_base::add object_base obj,
bool  owned
[pure virtual]
 

Add a new object to the composite object. The client passes in their understanding of the ownership policy to make sure that it fits in with the composites ownership. If they don't match, then the object won't be added, and the client can take appropriate action.

Implemented in reflect_test::c_ref, reflect_test::c_vector, persist_test::c_ref, and persist_test::c_vector.

Referenced by reflect_test::test_composite::test().

virtual bool ph::common::composite_object_base::remove object_base obj  )  [pure virtual]
 

Remove and object from the composite. Objects which are removed are not subject to the ownership policy of the composite, since they are simply forgotten by it.

Implemented in reflect_test::c_ref, reflect_test::c_vector, persist_test::c_ref, and persist_test::c_vector.

Referenced by reflect_test::test_composite::test().

virtual bool ph::common::composite_object_base::owned  )  const [inline, virtual]
 

Definition at line 56 of file composition_object.hpp.

Referenced by persist_test::c_vector::add(), reflect_test::c_vector::add(), persist_test::c_ref::add(), reflect_test::c_ref::add(), persist_test::c_vector::delete_object(), reflect_test::c_vector::delete_object(), persist_test::c_ref::delete_object(), and reflect_test::c_ref::delete_object().

virtual void ph::common::composite_object_base::owned bool  owned  )  [inline, virtual]
 

Return true of the collection is owned. normally this means that when the composite is deleted, the objects it contains are deleted with it, but on in a more complex system (which would need to provide the ability to clone objects), this could be used to provide owned/non-owned composites.

Definition at line 57 of file composition_object.hpp.

virtual bool ph::common::composite_object_base::singleton  )  const [pure virtual]
 

If the composite can only hold one value (so a second add() will fail for example), then this returns true. It is used when reflecting through composites to prevent subscripts being required.

Implemented in reflect_test::c_ref, reflect_test::c_vector, persist_test::c_ref, and persist_test::c_vector.

virtual int ph::common::composite_object_base::count  )  const [pure virtual]
 

Return the number of objects contained in this composite object.

Implemented in reflect_test::c_ref, reflect_test::c_vector, persist_test::c_ref, and persist_test::c_vector.

virtual composite_object_base* ph::common::composite_object_base::composite  )  [inline, virtual]
 

Reimplemented from ph::common::composition_object_base.

Definition at line 76 of file composition_object.hpp.

virtual const composite_object_base* ph::common::composite_object_base::composite  )  const [inline, virtual]
 

Reimplemented from ph::common::composition_object_base.

Definition at line 78 of file composition_object.hpp.


The documentation for this class was generated from the following file:
Generated on Wed Apr 5 22:03:33 2006 for cppxmlobj by  doxygen 1.4.3