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

OMF::Integer Class Reference

#include <Integer.hpp>

Inheritance diagram for OMF::Integer:

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

Detailed Description

The Integer class represents a basic integer in the modeling environment. While integers are typically defined in an open integral range of negative infinity to infinity, we only define them the size of a standard int.


Public Member Functions

 Integer ()
 Integer (const std::string &value)
 Integer (int value)
virtual ~Integer ()
const Integeroperator= (const std::string &value)
const Integeroperator= (int value)
 operator int () const
virtual unsigned 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
ModelObjectmetaObject ()

Protected Attributes

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


Constructor & Destructor Documentation

OMF::Integer::Integer  ) 
 

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

OMF::Integer::Integer int  value  ) 
 

virtual OMF::Integer::~Integer  )  [virtual]
 


Member Function Documentation

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

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

virtual unsigned OMF::Integer::hashCode  )  const [virtual]
 

The current thinking on the identity of integers is that most of them are pretty small. I can imagine that we'll never see a collection of integers so large that it actually uses all keys in a 64K key space. Our integer hashing algorithm is to simply mod the integer value by 64K (2<<16). We want to restrict this value because we want to avoid potential collisions in mixed object sets.

Reimplemented from OMF::Primitive.

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::Integer::operator int  )  const
 

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

const Integer& OMF::Integer::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::Integer::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 doxygen 1.3.8