Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

OMF::Container Class Reference

#include <Container.hpp>

Inheritance diagram for OMF::Container:

OMF::Object OMF::List OMF::Set List of all members.

Detailed Description

The Container class describes an abstract interface for all container types. It defines some generic access methods that allow usage of the container object. This class describes a very simple interface with the ability to add, remove and clear objects as well as iterate over the contents of the container.

Note that while primitives (and almost everything else in the OMF) has some kind of metaclass, containers don't. This is because the MOF doesn't define specific types of containers. Rather, this is simply an artifact of the implementation.


Public Member Functions

 Container ()
virtual ~Container ()
virtual size_t size () const =0
virtual bool empty () const =0
virtual Iterator begin ()=0
virtual Iterator end ()=0
virtual Iterator find (Object *obj)=0
virtual Iterator find (bool value)=0
virtual Iterator find (int value)=0
virtual Iterator find (const char *value)=0
virtual ConstIterator begin () const =0
virtual ConstIterator end () const =0
virtual ConstIterator find (Object *obj) const =0
virtual ConstIterator find (bool value) const =0
virtual ConstIterator find (int value) const =0
virtual ConstIterator find (const char *value) const =0
virtual void add (Object *obj)=0
virtual void add (bool value)=0
virtual void add (int value)=0
virtual void add (const char *value)=0
virtual void remove (Object *obj)=0
virtual void remove (bool value)=0
virtual void remove (int value)=0
virtual void remove (const char *value)=0
virtual void clear ()=0
bool contains (Object *obj) const
bool contains (bool value) const
bool contains (int value) const
bool contains (const char *value) const
void collect (OMF::Object *obj)
virtual unsigned hashCode () const
virtual const std::string & typeCode () const =0
ModelObjectmetaObject ()


Constructor & Destructor Documentation

OMF::Container::Container  ) 
 

virtual OMF::Container::~Container  )  [virtual]
 


Member Function Documentation

virtual void OMF::Container::add const char *  value  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual void OMF::Container::add int  value  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual void OMF::Container::add bool  value  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual void OMF::Container::add Object obj  )  [pure virtual]
 

Basic methods to append data.

Implemented in OMF::List, and OMF::Set.

virtual ConstIterator OMF::Container::begin  )  const [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual Iterator OMF::Container::begin  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual void OMF::Container::clear  )  [pure virtual]
 

Clears the collection.

Implemented in OMF::List, and OMF::Set.

void OMF::Container::collect OMF::Object obj  ) 
 

The collect method is a generic append for other list/set objects of the same type. The object must be a container for the collect to function. Note that if the object is not a container, no action is taken and no exception is raised.

bool OMF::Container::contains const char *  value  )  const
 

bool OMF::Container::contains int  value  )  const
 

bool OMF::Container::contains bool  value  )  const
 

bool OMF::Container::contains Object obj  )  const
 

The contains method tests for the existence of an object within the container.

virtual bool OMF::Container::empty  )  const [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual ConstIterator OMF::Container::end  )  const [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual Iterator OMF::Container::end  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual ConstIterator OMF::Container::find const char *  value  )  const [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual ConstIterator OMF::Container::find int  value  )  const [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual ConstIterator OMF::Container::find bool  value  )  const [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual ConstIterator OMF::Container::find Object obj  )  const [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual Iterator OMF::Container::find const char *  value  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual Iterator OMF::Container::find int  value  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual Iterator OMF::Container::find bool  value  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual Iterator OMF::Container::find Object obj  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual unsigned OMF::Container::hashCode  )  const [virtual]
 

The hash implementation for containers is to simply return the pointer value as an integer. We don't anticipate the need for value-based identity with containers.

Implements OMF::Object.

ModelObject* OMF::Object::metaObject  )  [inherited]
 

Return the meta-object of this instance. The meta-object is an instance of the metaclass of this object. For example, the metaclass of UML::Attribute is Model::Class. The metaobject for an instance of UML::Attribute is an instance of Model::Class.

This method may force a load of an entire metamodel in order to return the correct object.

virtual void OMF::Container::remove const char *  value  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual void OMF::Container::remove int  value  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual void OMF::Container::remove bool  value  )  [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual void OMF::Container::remove Object obj  )  [pure virtual]
 

Basic methods to remove data.

Implemented in OMF::List, and OMF::Set.

virtual size_t OMF::Container::size  )  const [pure virtual]
 

Implemented in OMF::List, and OMF::Set.

virtual const std::string& OMF::Object::typeCode  )  const [pure virtual, inherited]
 

The typeCode method returns a textual description of an object's type. This can vary between classifications of objects. For primitives and collections, the names are essentially static. For model objects, enumerations and collections the name of the object is the scoped name of the instantiating class. Note that the names of primitives are not typed.

Implemented in OMF::Boolean, OMF::Integer, OMF::List, OMF::ModelObject, OMF::Set, OMF::String, OMF::UnlimitedNatural, Model::AggregationKind, Model::DirectionKind, Model::EvaluationKind, Model::ScopeKind, Model::VisibilityKind, UML::AggregationKind, UML::CallConcurrencyKind, UML::ChangeableKind, UML::Geometry, UML::LocationReference, UML::Name, UML::OrderingKind, UML::ParameterDirectionKind, UML::PseudostateKind, UML::ScopeKind, UML::UnlimitedInteger, and UML::VisibilityKind.


The documentation for this class was generated from the following file:
Generated on Fri Sep 10 13:07:38 2004 for OpenModelingFramework by doxygen 1.3.8