CollisionShapeType Class Reference

A class representing the type of a collision shape object. More...

#include <rimPhysicsCollisionShapeType.h>

List of all members.

Public Member Functions

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

Private Attributes

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


Detailed Description

A class representing the type of a collision shape object.

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


Constructor & Destructor Documentation

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

Create a collision shape type from a string object.

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

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


Member Function Documentation

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

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

Hash CollisionShapeType::getID (  )  const [inline]

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

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

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

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

bool CollisionShapeType::operator!= ( const CollisionShapeType aType  )  const [inline]

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

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

The string representing a shape's type.

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

Hash CollisionShapeType::typeID [private]

The type ID of this shape 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 shape 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:19 2008 for Rim Physics by  doxygen 1.5.4