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

OMF::BasicExtension< Type > Class Template Reference

#include <Extension.hpp>

Inheritance diagram for OMF::BasicExtension< Type >:

OMF::Extension List of all members.

Detailed Description

template<class Type>
class OMF::BasicExtension< Type >

An extension is very much like a property but is not part of any standard metamodel. Rather than support the whole range of methods for an extension property, we simply provide get/set support. Extensions are not included in the basic set of properties and are not accessible via the same mechanisms. This procludes the possibility that a developer will overwrite an existing property of an element. This class is templated to provide "ready-made" extensions. Note that the templated type must be default-constructable. If the contained type is a dynamically allocated object, the user is responsible for the management of that memory. This could be done in several ways: respond to the object deleted event or create a derived class that overloads the destructor.

The Extension class by itself does not provide support for persistence. That is done through a derived class, PersistentExtension.


Public Member Functions

 BasicExtension (const std::string &name)
 BasicExtension (const std::string &name, Type &value)
virtual ~BasicExtension ()
Type & get ()
void set (Type &value)
const std::string & name () const

Protected Attributes

Type _value
std::string _name


Constructor & Destructor Documentation

template<class Type>
OMF::BasicExtension< Type >::BasicExtension const std::string &  name  ) 
 

template<class Type>
OMF::BasicExtension< Type >::BasicExtension const std::string &  name,
Type &  value
 

template<class Type>
virtual OMF::BasicExtension< Type >::~BasicExtension  )  [virtual]
 


Member Function Documentation

template<class Type>
Type& OMF::BasicExtension< Type >::get  ) 
 

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

template<class Type>
void OMF::BasicExtension< Type >::set Type &  value  ) 
 


Member Data Documentation

std::string OMF::Extension::_name [protected, inherited]
 

template<class Type>
Type OMF::BasicExtension< Type >::_value [protected]
 


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