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

OMF::UnlimitedNatural Class Reference

#include

Inheritance diagram for OMF::UnlimitedNatural:

OMF::Primitive OMF::Object List of all members.

Detailed Description

The UnlimitedNatural class represents a basic natural with a range of 0 to infinity. The value infinity is denoted by the integer value, -1, or the value "*". Note that the assignment and cast operators provided by this interface will attempt to interpret values of -1 as infinity. A special cast operator can be used to convert this into an unsigned value. In this case, note that the "*" value will become the highest positive value.


Public Member Functions

  UnlimitedNatural ()
  UnlimitedNatural (const std::string &value)
  UnlimitedNatural (int value)
virtual  ~UnlimitedNatural ()
const UnlimitedNatural operator= (const std::string &value)
const UnlimitedNatural operator= (int value)
  operator int () const
  operator unsigned () const
bool  isUnlimited () const
virtual size_t  hashCode () const
virtual const std::string &  typeCode () const
  operator const std::string & () const
  operator const char * () const
bool  empty () const
void  clear ()
const std::string &  str () const
ModelObject metaObject ()

Protected Attributes

bool  _empty
  True indicates a non-value.
std::string  _value
  The string value of the primitive.

Constructor & Destructor Documentation

OMF::UnlimitedNatural::UnlimitedNatural  ) 
 

OMF::UnlimitedNatural::UnlimitedNatural const std::string &  value  ) 
 

OMF::UnlimitedNatural::UnlimitedNatural int  value  ) 
 

virtual OMF::UnlimitedNatural::~UnlimitedNatural  )  [virtual]
 


Member Function Documentation

void OMF::Primitive::clear  )  [inherited]
 

bool OMF::Primitive::empty  )  const [inherited]
 

virtual size_t OMF::UnlimitedNatural::hashCode  )  const [virtual]
 

Hashing for unlimited naturals is the same as hashing for regular integers. Note that in the case of an unlimited value, the hash key will (fortunately) be 2^15-1.

Reimplemented from OMF::Primitive.

bool OMF::UnlimitedNatural::isUnlimited  )  const
 

Returns true if the natural value is unlimited (i.e., infinity).

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.

OMF::Primitive::operator const char *  )  const [inherited]
 

OMF::Primitive::operator const std::string &  )  const [inherited]
 

OMF::UnlimitedNatural::operator int  )  const
 

OMF::UnlimitedNatural::operator unsigned  )  const
 

const UnlimitedNatural& OMF::UnlimitedNatural::operator= int  value  ) 
 

const UnlimitedNatural& OMF::UnlimitedNatural::operator= const std::string &  value  ) 
 

Reimplemented from OMF::Primitive.

const std::string& OMF::Primitive::str  )  const [inherited]
 

Explicitly cast this object to a string.

virtual const std::string& OMF::UnlimitedNatural::typeCode  )  const [virtual]
 

The typeCode method returns a textual description of an object's type. This can vary between classifications of objects. For primitives and collections, the names are essentially static. For model objects, enumerations and collections the name of the object is the scoped name of the instantiating class. Note that the names of primitives are not typed.

Implements OMF::Object.


Member Data Documentation

bool OMF::Primitive::_empty [protected, inherited]
 

True indicates a non-value.

std::string OMF::Primitive::_value [protected, inherited]
 

The string value of the primitive.


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