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

OMF::Property Class Reference

#include <Property.hpp>

List of all members.


Detailed Description

This is the base class of all properties usable by model elements. A property is a generic wrapper for get/set functionality. There are two derived types: system properties which implement an abstraction over calling methods and user properties which must be defined by the user.


Public Types

enum  AssocPos { NoAssoc, First, Second }
enum  AssocLevel { None, Weak, Strong }

Public Member Functions

 Property (const std::string &name)
virtual ~Property ()
template<class Self, class Type> PropertygetMethod (Self *self, const Type &(Self::*method)() const)
template<class Self, class Type> PropertygetMethod (Self *self, const Type &(Self::*method)())
template<class Self, class Type> PropertygetMethod (Self *self, Type *(Self::*method)())
template<class Self, class Type> PropertysetMethod (Self *self, void(Self::*method)(const Type &))
template<class Self, class Type> PropertysetMethod (Self *self, void(Self::*method)(Type *))
template<class Self, class Type> PropertyaddMethod (Self *self, void(Self::*method)(const Type &))
template<class Self, class Type> PropertyaddMethod (Self *self, void(Self::*method)(Type *))
template<class Self, class Type> PropertyremoveMethod (Self *self, void(Self::*method)(const Type &))
template<class Self, class Type> PropertyremoveMethod (Self *self, void(Self::*method)(Type *))
template<class Self> PropertyclearMethod (Self *self, void(Self::*method)())
Propertyassoc (Association *assoc, AssocPos pos, AssocLevel level)
const std::string & name () const
virtual bool canGet () const
virtual bool canSet () const
virtual bool canAdd () const
virtual bool canRemove () const
virtual bool canClear () const
virtual Objectget ()
virtual void set (Object *value)
virtual void add (Object *value)
virtual void remove (Object *value)
virtual void clear ()
Associationassociation ()
AssocPos position () const
AssocLevel level () const


Member Enumeration Documentation

enum OMF::Property::AssocLevel
 

The AssocLevel defines the level of aggregation used in an association. It is analagous to Model::AggregationKind, but we need simpler identities here. The relation is either Weak or Strong. Note that this simply denotes containment semantics for properties. Properties with strong associations denote the containment tree.

Enumeration values:
None 
Weak 
Strong 

enum OMF::Property::AssocPos
 

The AssocPos enumeration defines the position of the property in relation to an associated association. The property could be either first or second. Note that the NoAssoc is used in cases where we want to denote strong ownership of an element that has no corresponding association such as structures and class attributes.

Enumeration values:
NoAssoc 
First 
Second 


Constructor & Destructor Documentation

OMF::Property::Property const std::string &  name  ) 
 

virtual OMF::Property::~Property  )  [virtual]
 


Member Function Documentation

virtual void OMF::Property::add Object value  )  [virtual]
 

template<class Self, class Type>
Property& OMF::Property::addMethod Self *  self,
void(Self::*  method)(Type *)
 

template<class Self, class Type>
Property& OMF::Property::addMethod Self *  self,
void(Self::*  method)(const Type &)
 

Property& OMF::Property::assoc Association assoc,
AssocPos  pos,
AssocLevel  level
 

This method is used to relate an association with the property. Using this, clients can access the desired association and related information (such as the end location - first or second) without having to refer to the metamodel. Note that this method should never be called outside the constructor of defining classes. To access the association information, use the association() method.

Parameters:
assoc A pointer to the association extent representing the association. @ param pos The feature being defined is the feature that is modified for the element passed in this position. For example, in the Model namespace, Namespace::contents is defined in the first position, where the first parameter to Contains::add is a namespace. the Contains::add method modifies the "contents" feature of the first parameter. Likewise, ModelElement::container is second, because the second parameter of the add() method, containedElement, is modified.
level The level of ownership: weak or strong. Strong indicates whole ownership whereas weak indicates shared. Like the pos parameter, this method applies to the level of ownership of the position in the association. For example, Namespace::contents is strong ownership because a namespace exists longer than its contained elements.

Association* OMF::Property::association  ) 
 

virtual bool OMF::Property::canAdd  )  const [virtual]
 

virtual bool OMF::Property::canClear  )  const [virtual]
 

virtual bool OMF::Property::canGet  )  const [virtual]
 

virtual bool OMF::Property::canRemove  )  const [virtual]
 

virtual bool OMF::Property::canSet  )  const [virtual]
 

virtual void OMF::Property::clear  )  [virtual]
 

template<class Self>
Property& OMF::Property::clearMethod Self *  self,
void(Self::*  method)()
 

virtual Object* OMF::Property::get  )  [virtual]
 

template<class Self, class Type>
Property& OMF::Property::getMethod Self *  self,
Type *(Self::*  method)()
 

template<class Self, class Type>
Property& OMF::Property::getMethod Self *  self,
const Type &(Self::*  method)()
 

template<class Self, class Type>
Property& OMF::Property::getMethod Self *  self,
const Type &(Self::*  method)() const
 

AssocLevel OMF::Property::level  )  const
 

const std::string& OMF::Property::name  )  const
 

Return the name of the property.

AssocPos OMF::Property::position  )  const
 

virtual void OMF::Property::remove Object value  )  [virtual]
 

template<class Self, class Type>
Property& OMF::Property::removeMethod Self *  self,
void(Self::*  method)(Type *)
 

template<class Self, class Type>
Property& OMF::Property::removeMethod Self *  self,
void(Self::*  method)(const Type &)
 

virtual void OMF::Property::set Object value  )  [virtual]
 

template<class Self, class Type>
Property& OMF::Property::setMethod Self *  self,
void(Self::*  method)(Type *)
 

template<class Self, class Type>
Property& OMF::Property::setMethod Self *  self,
void(Self::*  method)(const Type &)
 


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