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

Model::Class Class Reference

#include

Inheritance diagram for Model::Class:

Model::Classifier Model::GeneralizableElement Model::Namespace Model::ModelElement OMF::ModelObject OMF::Object Model::ClassImpl List of all members.

Detailed Description

A Class is a classification of object instances defining the object state and feature possibilities. These are defined by associated references, attributes and operations.

Defined in [3.4.6].


Public Types

typedef OMF::BasicClass< ClassImpl,
OMF::Concrete > 
Proxy

Public Member Functions

  Class ()
virtual  ~Class ()
const OMF::Boolean isSingleton () const
void  setIsSingleton (const OMF::Boolean &isSingleton)
void  clearIsSingleton ()
const OMF::Boolean isRoot () const
void  setIsRoot (const OMF::Boolean &isRoot)
void  clearIsRoot ()
const OMF::Boolean isLeaf () const
void  setIsLeaf (const OMF::Boolean &isLeaf)
void  clearIsLeaf ()
const OMF::Boolean isAbstract () const
void  setIsAbstract (const OMF::Boolean &isAbstract)
void  clearIsAbstract ()
const VisibilityKind visibility () const
void  setVisibility (const VisibilityKind &vis)
void  clearVisibility ()
const OMF::List supertypes () const
void  addSupertypes (GeneralizableElement *super)
void  removeSupertypes (GeneralizableElement *super)
void  clearSupertypes ()
OMF::List  allSupertypes ()
virtual ModelElement *  lookupElementExtended (const OMF::String &name)
virtual OMF::List  findElementsByType (Class *ofType, const OMF::Boolean &includeSubtypes)
const OMF::List contents () const
void  addContents (ModelElement *element)
void  removeContents (ModelElement *element)
void  clearContents ()
ModelElement *  lookupElement (const OMF::String &name)
ModelElement *  resolveQualifiedName (const OMF::List &qualifiedName)
OMF::Boolean  nameIsValid (const OMF::String &name)
const OMF::String name () const
void  setName (const OMF::String &name)
void  clearName ()
const OMF::String annotation () const
void  setAnnotation (const OMF::String &annotation)
void  clearAnnotation ()
const OMF::Set requiredElements () const
void  addRequiredElements (ModelElement *element)
void  removeRequiredElements (ModelElement *element)
void  clearRequiredElements ()
const OMF::Set constraints () const
void  addConstraints (Constraint *constraint)
void  removeConstraints (Constraint *constraint)
void  clearConstraints ()
Namespace *  container ()
void  setContainer (Namespace *container)
void  clearContainer ()
const OMF::List qualifiedName ()
OMF::Set  findRequiredElements (const OMF::Set &kinds, const OMF::Boolean &recursive)
OMF::Boolean  isRequiredBecause (ModelElement *otherElement, OMF::String &reason)
OMF::Boolean  isFrozen ()
OMF::Boolean  isVisible (ModelElement *otherElement)
virtual unsigned  hashCode () const
virtual const std::string &  typeCode () const
const std::string  id () const
void  setId (const std::string &id)
void  incRef ()
void  decRef ()
void  purge ()
ModelObject *  parent ()
void  setParent (ModelObject *parent)
Model *  model ()
void  setModel (Model *model)
const std::vector< Property * > &  propertyList () const
const std::map< std::string,
Property * > & 
allProperties () const
bool  hasProperty (const std::string &name) const
Property *  getProperty (const std::string &name) const
Object *  get (const std::string &name)
void  set (const std::string &name, Object *value)
void  add (const std::string &name, Object *value)
void  remove (const std::string &name, Object *value)
void  clear (const std::string &name)
void  extend (Extension *ext)
template void  extendWith (const std::string &name, Type &value)
template void  extendWith (const std::string &name)
bool  hasExtension (const std::string &name)
Extension *  extension (const std::string &name)
void  removeExtension (const std::string &name)
Class proxy ()
Package *  decl ()
ModelObject *  metaObject ()

Protected Member Functions

Property &  defProperty (const std::string &name)

Member Typedef Documentation

typedef OMF::BasicClass Model::Class::Proxy
 

Reimplemented from Model::Classifier.


Constructor & Destructor Documentation

Model::Class::Class  ) 
 

virtual Model::Class::~Class  )  [virtual]
 


Member Function Documentation

void OMF::ModelObject::add const std::string &  name,
Object value
[inherited]
 

Add the value of a named property.

void Model::ModelElement::addConstraints Constraint *  constraint  )  [inherited]
 

void Model::Namespace::addContents ModelElement *  element  )  [inherited]
 

void Model::ModelElement::addRequiredElements ModelElement *  element  )  [inherited]
 

void Model::GeneralizableElement::addSupertypes GeneralizableElement *  super  )  [inherited]
 

const std::map<:string property>& OMF::ModelObject::allProperties  )  const [inherited]
 

Return all properties.

OMF::List Model::GeneralizableElement::allSupertypes  )  [inherited]
 

Returns a list of direct and indirect supertypes of this element. The order of the list of elements is determined by a depth first traversal of the supertypes with duplicates removed.

Returns:
The transitive closure of supertypes.

const OMF::String& Model::ModelElement::annotation  )  const [inherited]
 

void OMF::ModelObject::clear const std::string &  name  )  [inherited]
 

Clear the value of a named property.

void Model::ModelElement::clearAnnotation  )  [inherited]
 

void Model::ModelElement::clearConstraints  )  [inherited]
 

void Model::ModelElement::clearContainer  )  [inherited]
 

void Model::Namespace::clearContents  )  [inherited]
 

void Model::GeneralizableElement::clearIsAbstract  )  [inherited]
 

void Model::GeneralizableElement::clearIsLeaf  )  [inherited]
 

void Model::GeneralizableElement::clearIsRoot  )  [inherited]
 

void Model::Class::clearIsSingleton  ) 
 

void Model::ModelElement::clearName  )  [inherited]
 

void Model::ModelElement::clearRequiredElements  )  [inherited]
 

void Model::GeneralizableElement::clearSupertypes  )  [inherited]
 

void Model::GeneralizableElement::clearVisibility  )  [inherited]
 

const OMF::Set& Model::ModelElement::constraints  )  const [inherited]
 

Namespace* Model::ModelElement::container  )  [inherited]
 

const OMF::List& Model::Namespace::contents  )  const [inherited]
 

Package* OMF::ModelObject::decl  )  [inherited]
 

Returns package that declares this class of this object.

void OMF::ModelObject::decRef  )  [inherited]
 

Property& OMF::ModelObject::defProperty const std::string &  name  )  [protected, inherited]
 

Provided so derived classes can add properties. This returns the newly allocated property object so it can be altered in a chained method x().y().z().

void OMF::ModelObject::extend Extension *  ext  )  [inherited]
 

Extend the object with a new property. This entails the external construction of the extension that will be used by the model object. This is more useful for specialized extensions.

template
void OMF::ModelObject::extendWith const std::string &  name  )  [inherited]
 

This method is like the above, but the caller does not need a default value for the extension.

template
void OMF::ModelObject::extendWith const std::string &  name,
Type &  value
[inherited]
 

This method is much like the first but internalizes the construction of the extension element. It uses the basic extension class and wraps the given value.

Extension* OMF::ModelObject::extension const std::string &  name  )  [inherited]
 

Get the named extension property.

virtual OMF::List Model::GeneralizableElement::findElementsByType Class ofType,
const OMF::Boolean includeSubtypes
[virtual, inherited]
 

This method works much like the findElementsByType() method except that it also searches the contents of all supertype classes. Note that this method can also be overloaded to provide further specialization such as in the pack class. The returned list is calculated in a depth first search of the inheritance lattice.

Parameters:
ofType  The type of object to search for
includeSubtypes  Include subtypes in the search or just the actual instances.
Returns:
A list of all types of the given class.

Reimplemented from Model::Namespace.

OMF::Set Model::ModelElement::findRequiredElements const OMF::Set kinds,
const OMF::Boolean recursive
[inherited]
 

This operation selects a subset of model elements that this element depends on. The kinds parameter gives the kinds of depencies of interest to the caller. Note that the values of the kinds parameter are defined by the standard constants in the MOF defined in [3.8]. If the recursive parameter is true, this method returns the transitive closure of the DependsOn association (all dependencies for the specified kinds).

Parameters:
kinds  The kinds of dependencies to return
recursive  If true, compute the transitive closure
Returns:
The discovered dependencies.

Object* OMF::ModelObject::get const std::string &  name  )  [inherited]
 

Get a named property of the object.

Property* OMF::ModelObject::getProperty const std::string &  name  )  const [inherited]
 

This method is used to return the property object for the requested name. This can be useful if the client needs to test some of the capabilities of the property prior to manipulating it.

bool OMF::ModelObject::hasExtension const std::string &  name  )  [inherited]
 

Does the object support a named extension?

virtual unsigned OMF::ModelObject::hashCode  )  const [virtual, inherited]
 

Hash codes for model objects are the integer representation of the this pointer. The pointer value is actually the identity of the object, so it seems like a good solution for hashing.

Implements OMF::Object.

bool OMF::ModelObject::hasProperty const std::string &  name  )  const [inherited]
 

This method is used to query whether or not a property is actually defined for this object. Note that we can't just test using get because the property may exist, but be a null pointer.

const std::string OMF::ModelObject::id  )  const [inherited]
 

Return the id of this object. Can be empty.

void OMF::ModelObject::incRef  )  [inherited]
 

const OMF::Boolean& Model::GeneralizableElement::isAbstract  )  const [inherited]
 

OMF::Boolean Model::ModelElement::isFrozen  )  [inherited]
 

Reports the "freeze" status of a model element. All model elements of a published model (such as this) are frozen. In effect, this method will always return false because I don't care about freeze status.

Returns:
Always false.

const OMF::Boolean& Model::GeneralizableElement::isLeaf  )  const [inherited]
 

OMF::Boolean Model::ModelElement::isRequiredBecause ModelElement *  otherElement,
OMF::String reason
[inherited]
 

This operation performs two functions. It checks whether the model element depends on the given element. If so, the method returns true. Also, If there is a dependency, the operation sets the reason parameter to the kind of dependency.

Parameters:
otherElement  The element to check for dependence
reason  The reason for the dependence if there is a dependency.
Returns:
True if there is a dependency.

const OMF::Boolean& Model::GeneralizableElement::isRoot  )  const [inherited]
 

const OMF::Boolean& Model::Class::isSingleton  )  const
 

OMF::Boolean Model::ModelElement::isVisible ModelElement *  otherElement  )  [inherited]
 

This method always returns true (as per the standard) and is reserved for future use (which it never was used). Theoretically, we could implement it to determine whether the given element is visible from this element. In other words, there is a path through the containment tree from this element to the other that is not blocked by private visibilities.

Parameters:
otherElement  the element to deterimine visibility for
Returns:
Always true

ModelElement* Model::Namespace::lookupElement const OMF::String name  )  [inherited]
 

This method searches for an element contained by this namespace whose name is precisely equal to the given name. The operation returns the element with the given name or null if no such element is found. The standards wants us to throw an exception here, but that seems a bit like overkill.

Parameters:
name  The name of the element to find
Returns:
The model element with the corresponding name or null

virtual ModelElement* Model::GeneralizableElement::lookupElementExtended const OMF::String name  )  [virtual, inherited]
 

This method works much like lookupElement() except that it also searches the contents of all supertype classes. Note that this method can also be overloaded to provide further specialization such as in the Package class.

Parameters:
name  The name to search for
Returns:
The model element with the given name, or null if not found

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.

Model* OMF::ModelObject::model  )  [inherited]
 

Return the model that owns this object.Note that this method can return null... in the case where this happens, we're really dealing with fragments of models. However, inserting the fragment into a model will resolve the ownership of the element.

const OMF::String& Model::ModelElement::name  )  const [inherited]
 

OMF::Boolean Model::Namespace::nameIsValid const OMF::String name  )  [inherited]
 

Determines if a proposed name is valid. Rather than enforce some kind of lame constraints in this area, we're going to be considerably more forgiving. This method will always return true.

Returns:
Always true

ModelObject* OMF::ModelObject::parent  )  [inherited]
 

Return the owner of this object or - the parent in the containment tree (after which the method is named).

Reimplemented in UML::Generalization.

const std::vector& OMF::ModelObject::propertyList  )  const [inherited]
 

Return a list of properties (ordered by definition). This method shouldn't really be used. It's kind of a hack that's been added to support XMI 1.2 field referencing for structure types.

Class* OMF::ModelObject::proxy  )  [inherited]
 

Get the class proxy for this model object.

void OMF::ModelObject::purge  )  [inherited]
 

The purge method is a work-around for cases where the object must be deleted immediately (such as composite aggregation). This method deletes this object. Do not refer to it after calling this method.

const OMF::List& Model::ModelElement::qualifiedName  )  [inherited]
 

While the qualifiedName is typically described as an attribute of a model element, it's actually easier to just compute the list. Note that the qualified name is recomputed and stored locally every time this method is invoked. Also, this method is part of a read-only property.

void OMF::ModelObject::remove const std::string &  name,
Object value
[inherited]
 

Remove a value from a named property.

void Model::ModelElement::removeConstraints Constraint *  constraint  )  [inherited]
 

void Model::Namespace::removeContents ModelElement *  element  )  [inherited]
 

void OMF::ModelObject::removeExtension const std::string &  name  )  [inherited]
 

Remove the named extension.

void Model::ModelElement::removeRequiredElements ModelElement *  element  )  [inherited]
 

void Model::GeneralizableElement::removeSupertypes GeneralizableElement *  super  )  [inherited]
 

const OMF::Set& Model::ModelElement::requiredElements  )  const [inherited]
 

ModelElement* Model::Namespace::resolveQualifiedName const OMF::List qualifiedName  )  [inherited]
 

This method searches for a model element contained within this namespace based on a qualified name. Note that the qualified name is interpreted as the "path" to the object. Again, the standards want exceptions, but I think returning null should be appropriate.

Parameters:
qualifiedName  A list of component names to search for
Returns:
The resolved element or null if not resolved

void OMF::ModelObject::set const std::string &  name,
Object value
[inherited]
 

Set the value of a named property.

void Model::ModelElement::setAnnotation const OMF::String annotation  )  [inherited]
 

void Model::ModelElement::setContainer Namespace *  container  )  [inherited]
 

void OMF::ModelObject::setId const std::string &  id  )  [inherited]
 

Never, ever call this method. It is used internally by this class and the Model class to set the ids for objects that are used during serialization.

void Model::GeneralizableElement::setIsAbstract const OMF::Boolean isAbstract  )  [inherited]
 

void Model::GeneralizableElement::setIsLeaf const OMF::Boolean isLeaf  )  [inherited]
 

void Model::GeneralizableElement::setIsRoot const OMF::Boolean isRoot  )  [inherited]
 

void Model::Class::setIsSingleton const OMF::Boolean isSingleton  ) 
 

void OMF::ModelObject::setModel Model *  model  )  [inherited]
 

This method should only ever be called from within the model class and only when a new top-level object is assigned to the model.

void Model::ModelElement::setName const OMF::String name  )  [inherited]
 

void OMF::ModelObject::setParent ModelObject parent  )  [inherited]
 

Set the parent in the containment tree. Note that this method should only ever be called by a reference mutator. It should not be the job of the client to manage containment relations. This method will recursively set the model for all owned elements of this object to the model of the owning object. It will also reallocate ids (if the parent has a model).

void Model::GeneralizableElement::setVisibility const VisibilityKind vis  )  [inherited]
 

const OMF::List& Model::GeneralizableElement::supertypes  )  const [inherited]
 

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

The typecode of a model object is the name of the model object's class.

Implements OMF::Object.

const VisibilityKind& Model::GeneralizableElement::visibility  )  const [inherited]
 


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