ForceType Class Reference

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

#include <rimPhysicsForceType.h>

List of all members.

Public Member Functions

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

Private Attributes

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


Detailed Description

A class representing the type of a force object.

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


Constructor & Destructor Documentation

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

Create a force type from a string object.

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

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


Member Function Documentation

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

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

Hash ForceType::getID (  )  const [inline]

Get the ID of this force 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 force 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 force type.

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

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

The condition for equality is that the type ID of this force type be equal to that of the other force type. While it is possible that two force 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 ForceType::typeString [private]

The string representing a force's type.

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

Hash ForceType::typeID [private]

The type ID of this force 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 force 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