Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::OSCARError Class Reference
[Base]

Defines an error object that contains an integer value and an error description. More...

#include <OSCARError.h>

List of all members.

Public Methods

 OSCARError (int errorCode, const String &basicDescription, const String &customDescription=String())
 OSCARError (const OSCARError &rhs)
virtual ~OSCARError ()
OSCARError & operator= (const OSCARError &rhs)
void SetErrorCode (int errorCode)
void SetBasicDescription (const String &basicDesc)
void SetCustomDescription (const String &customDesc)
int GetErrorCode () const
const StringGetBasicDescription () const
const StringGetCustomDescription () const
 operator int () const
bool operator== (const OSCARError &err) const
bool operator!= (const OSCARError &err) const

Protected Attributes

int errorCode
String basicDescription
String customDescription


Detailed Description

Author:
Chetan Kapoor
Assists in error reporting. OSCARError objects contain specific information about the error state of each object in OSCAR. Each OSCARError object consists of an integer value that can uniquely define the error, and a string description of the error.


Constructor & Destructor Documentation

OSCAR::OSCARError::OSCARError int    errorCode,
const String   basicDescription,
const String   customDescription = String()
 

Constructor.

This is the Constructor for an object of type OSCARError. Use this to construct OSCARError objects with an integer error code, a basic description of the error, and a customized description.

Parameters:
errorCode An integer value that can uniquely define the error.
basicDescription An String that gives a textual description of the error.
customDescription An String that can be used to specify an additional context specific error description. For example, this String could be used to hold the name of the object that caused the error, or it could be used to hold information such as the number of the joint that violated a joint limit, etc. The default value for the customDescription is "";

OSCAR::OSCARError::OSCARError const OSCARError &    rhs
 

Copy Constructor.

This is the Copy Constructor for an object of type OSCARError. Use this to construct an OSCARError object from an existing OSCARError object.

Parameters:
rhs An OSCARError object that is used to initialize and construct this object

virtual OSCAR::OSCARError::~OSCARError   [virtual]
 

Virtual Destructor.

This is the Destructor for an object of type OSCARError.


Member Function Documentation

const String& OSCAR::OSCARError::GetBasicDescription   const
 

Get the basic error description.

This method is used to get the basic error description.

Returns:
A constant String reference that holds the basic error description.
See also:
SetBasicDescription()

const String& OSCAR::OSCARError::GetCustomDescription   const
 

Get the custom error description.

This method is used to get the custom error description.

Returns:
A constant String reference that holds the custom error description.
See also:
SetCustomDescription()

int OSCAR::OSCARError::GetErrorCode   const
 

Get the error code.

This method is used to get the error code.

Returns:
An integer value that specifies the error code.
See also:
SetErrorCode()

OSCAR::OSCARError::operator int   const
 

Typecast an OSCARError object into an int.

This method is used to typecast an OSCARError object into an int. This allows you to use OSCARError instead of int's for returning simple error codes. Also, this supports legacy OSCAR code in which OSCARError's were defined as int's

Returns:
An integer value that specifies the error code.
See also:
GetErrorCode()

SetErrorCode()

bool OSCAR::OSCARError::operator!= const OSCARError &    err const
 

Overloaded operator!=.

This overloaded operator!= is used to compare two RROSCARObjects. Basically, the integer error code inside each OSCARError object is used as the basis for comparison. This method is constant.

Parameters:
err An OSCARError object that goes on the right hand side of the != operator.
Returns:
A boolean value of true or false, based on whether the error objects were not equal or equal.
See also:
operator==()

OSCARError& OSCAR::OSCARError::operator= const OSCARError &    rhs
 

Assignment Operator.

This is the assignment operator for an object of type OSCARError.

Parameters:
rhs An OSCARError object that goes on the right hand side of the = operator.
Returns:
A reference to the object on the left hand side of the = operator.

bool OSCAR::OSCARError::operator== const OSCARError &    err const
 

Overloaded operator==.

This overloaded operator== is used to compare two RROSCARObjects. Basically, the integer error code inside each OSCARError object is used as the basis for comparison. This method is constant.

Parameters:
err An OSCARError object that goes on the right hand side of the == operator.
Returns:
A boolean value of true or false, based on whether the error objects were equal or not.
See also:
operator!=()

void OSCAR::OSCARError::SetBasicDescription const String   basicDesc
 

Set the basic error description.

This method is used to set the basic error description.

Parameters:
basicDesc A String that gives a textual description of the error.
See also:
GetBasicDescription()

void OSCAR::OSCARError::SetCustomDescription const String   customDesc
 

Set the custom error description.

This method is used to set a custom error description. Use this method to specify additional context specific error descriptions. For example, the String parameter could be used to hold the name of the object that caused the error, or it could be used to hold information such as the number of the joint that violated a joint limit, etc. The default value for the customDescription is "";

Parameters:
customDesc A String that gives additional context specific error description.
See also:
GetCustomDescription()

void OSCAR::OSCARError::SetErrorCode int    errorCode
 

Set the error code.

This method is used to set the error code to the value of the parameter passed in.

Parameters:
errorCode An integer value that can uniquely define the error.
See also:
GetErrorCode()


Member Data Documentation

String OSCAR::OSCARError::basicDescription [protected]
 

String OSCAR::OSCARError::customDescription [protected]
 

int OSCAR::OSCARError::errorCode [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations