ConstraintType Class Reference

A class representing the type of a constraint object. More...

#include <rimPhysicsConstraintType.h>

List of all members.

Public Member Functions

 ConstraintType (const String &string)
 Create a constraint type from a string object.
 ConstraintType (const char *string)
 Create a constraint type from pointer to a c-style character array.
const StringgetString () const
 Get a reference to the constraint type's string representation.
Hash getID () const
 Get the ID of this constraint type.
bool operator== (const ConstraintType &aType) const
 Return whether or not this constraint type is equal to another.

Private Attributes

String typeString
 The string representing a constraint's type.
Hash typeID
 The type ID of this constraint type.


Detailed Description

A class representing the type of a constraint object.

The class consists of two values. The first is a string object of any length which defines the name of a constraint type. The second value is the type ID of the constraint type. This is a unique integral value which is calculated by hashing the type's string. While it is possible that two constraint types with different type strings will have the same hash code, it is highly unlikely. If this occurs, the behavior is undefined. Constraint types are compared for equality by an overloaded == operator which compares the type IDs of the constraints.


Constructor & Destructor Documentation

ConstraintType::ConstraintType ( const String string  )  [inline]

Create a constraint type from a string object.

ConstraintType::ConstraintType ( const char *  string  )  [inline]

Create a constraint type from pointer to a c-style character array.


Member Function Documentation

const String& ConstraintType::getString (  )  const [inline]

Get a reference to the constraint type's string representation.

Hash ConstraintType::getID (  )  const [inline]

Get the ID of this constraint type.

This value is calculated by finding the hash code of type's string representation. It is a unique integral value. While it is possible that two constraint types with different type strings will have the same hash code, it is highly unlikely. If this occurs, the behavior is undefined.

Returns:
the type ID of this constraint type.

bool ConstraintType::operator== ( const ConstraintType aType  )  const [inline]

Return whether or not this constraint type is equal to another.

The condition for equality is that the type ID of this constraint type be equal to that of the other constraint type. While it is possible that two constraint types with different type strings will have the same type ID, it is highly unlikely. If this occurs, the behavior is undefined.


Member Data Documentation

String ConstraintType::typeString [private]

The string representing a constraint's type.

The hash code of this string is used as the constraint type's unique integer identifier. While it is possible that two constraint types with different type strings will have the same hash code, it is highly unlikely. If this occurs, the behavior is undefined.

Hash ConstraintType::typeID [private]

The type ID of this constraint type.

This value is calculated by finding the hash code of type's string representation. It is a unique integral value. While it is possible that two constraint types with different type strings will have the same hash code, it is highly unlikely. If this occurs, the behavior is undefined.


The documentation for this class was generated from the following file:
Generated on Tue Aug 26 00:03:20 2008 for Rim Physics by  doxygen 1.5.4