#include
Inheritance diagram for OMF::ModelObject:
The ModelObject class acts as a replacement for the standard MOF reflective capabilities. This is because we aren't actually bootstrapping the implementation, but building it from the ground up. Had we chosen otherwise, we could use a true MOF class as the base for all modeling objects.
Public Member Functions |
|
virtual | ~ModelObject () |
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 |
extendWith (const std::string &name, Type &value) |
template |
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 |
|
ModelObject () | |
ModelObject (const std::string &mc, Class *proxy, Package *decl) | |
Property & | defProperty (const std::string &name) |
|
Never, ever used. |
|
Default constuctor. Requires a fully qualified metaclass name, a proxy and a package. |
|
|
Add the value of a named property. |
|
Return all properties. |
|
Clear the value of a named property. |
|
Returns package that declares this class of this object. |
|
|
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(). |
|
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. |
|
This method is like the above, but the caller does not need a default value for the extension. |
|
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. |
|
Get the named extension property. |
|
Get a named property of the object. |
|
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. |
|
Does the object support a named extension? |
|
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. |
|
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. |
|
Return the id of this object. Can be empty. |
|
|
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. |
|
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. |
|
Return the owner of this object or - the parent in the containment tree (after which the method is named). Reimplemented in UML::Generalization. |
|
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. |
|
Get the class proxy for this model object. |
|
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. |
|
Remove a value from a named property. |
|
Remove the named extension. |
|
Set the value of a named property. |
|
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. |
|
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. |
|
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). |
|
The typecode of a model object is the name of the model object's class. Implements OMF::Object. |