#include <Model.hpp>
Public Types | |
enum | Mode { ReadOnly, ReadWrite } |
Public Member Functions | |
Model () | |
~Model () | |
const std::string & | fileName () const |
void | setFileName (const std::string &fname) |
const std::string & | path () const |
void | setPath (const std::string &path) |
Mode | mode () const |
void | setMode (Mode mode) |
bool | read (const char *filename) |
bool | write (const char *filename) |
const std::list< ModelObject * > & | elements () const |
void | addElement (ModelObject *elem) |
void | removeElement (ModelObject *elem) |
void | identifyElement (ModelObject *elem) |
ModelObject * | findElement (const std::string &id) |
void | enableIdentification (bool id) |
std::string | generateId () |
void | nextId () |
unsigned | currentId () const |
const std::set< Package * > | metamodels () const |
void | addMetamodel (Package *pkg) |
|
Defines the mode in which the file is opened. By default, the mode is ReadWrite, but if the permissions on a file are read only, the mode is set to read only. |
|
|
|
|
|
Add a new top level element to the model. This method ensures that all subordinate elements (in the containment tree) have their owning model set to this and their ids are allocated appropriately. |
|
Add a new metamodel for this model. |
|
Pretty much just used for debugging. Returns the current id allocator value. |
|
Return the list of all top level elements. |
|
This method is called to disable or enable the generation of ids during XMI parsing. |
|
Return the filename of the model. |
|
The findElement method is used to find an element by a requested id. As elements are added to the model (either directly or indirectly), they are all added to this mapping. |
|
This method generates monotonically increasing ids for elements assigned into this model. The id is basically an integer value that is unique to the context of this model. |
|
This method is used to control the setting of identification and it's mapping into the identity map. |
|
Return the set of metamodels used by this model. |
|
Return the mode that the model was created/opened in. |
|
Move to the next id. |
|
Return the path of the model. |
|
Read a model from a file. |
|
Remove a top-level model element from the model. This method recursively iterates through the removed element and resets the model pointer for all contained elements. |
|
Set the filename. |
|
Set the mode of the model. |
|
Set the path to the file. |
|
Write a model to the file. |