Teamcenter C++ API Reference  2312
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
IFail Class Reference

A throwable class used to store errors on the error stack. More...

#include <IFail.hxx>

Public Member Functions

void getAndClearErrorStack (std::vector< int > &errorCodes, std::vector< int > &severities, std::vector< std::string > &errorMessages)
 
const std::string & getMessage () const
 
 IFail ()
 
 IFail (int ifail, const char *s1=0, const char *s2=0, const char *s3=0, const char *s4=0, const char *s5=0, const char *s6=0, const char *s7=0)
 
 IFail (int ifail, const std::string &s1)
 
 IFail (int ifail, const std::string &s1, const std::string &s2)
 
int ifail () const
 
 operator int () const
 
 ~IFail ()
 

Private Member Functions

 IFail (bool storeError, int ifail)
 

Private Attributes

int m_ifail
 
std::string m_message
 

Friends

class ResultCheck
 
class ResultStatus
 

Detailed Description

A throwable class used to store errors on the error stack.

try
{
[...]
int retCode = POM_get_user( &userName, &vUserTag );
if( retCode!=ITK_ok || vUserTag == NULLTAG )
{
throw IFail(TIE_null_attribute, ValidationResultClassName, VALIDATION_USER);
}
[...]
}
catch ( const IFail& ifail )
{
[...]
}

Definition at line 49 of file IFail.hxx.

Constructor & Destructor Documentation

IFail::IFail ( )

Default constructor.
It uses the last error stored on the error stack.

IFail::IFail ( int  ifail,
const char *  s1 = 0,
const char *  s2 = 0,
const char *  s3 = 0,
const char *  s4 = 0,
const char *  s5 = 0,
const char *  s6 = 0,
const char *  s7 = 0 
)

Constructor of an instance with a provided error code and its associated parameters.

Parameters
[in]ifailThe error code
[in]s1Substitution for the parameter 1 in the displayable error message.
[in]s2Substitution for the parameter 2 in the displayable error message.
[in]s3Substitution for the parameter 3 in the displayable error message.
[in]s4Substitution for the parameter 4 in the displayable error message.
[in]s5Substitution for the parameter 5 in the displayable error message.
[in]s6Substitution for the parameter 6 in the displayable error message.
[in]s7Substitution for the parameter 7 in the displayable error message.
IFail::IFail ( int  ifail,
const std::string &  s1 
)

std::string overloads. Add more as required.

IFail::IFail ( int  ifail,
const std::string &  s1,
const std::string &  s2 
)
IFail::~IFail ( )
                                                                                                                                                                                         /**

Destructor

IFail::IFail ( bool  storeError,
int  ifail 
)
private

Private constructor

Member Function Documentation

void IFail::getAndClearErrorStack ( std::vector< int > &  errorCodes,
std::vector< int > &  severities,
std::vector< std::string > &  errorMessages 
)

Retrieves the contents of the error stack, and then clears the error stack.
The older error is at the last position of the arrays for this method.

Note
The errors are returned in reverse order compared to a call to the EMH_ask_errors.
Parameters
[in]errorCodesThe list of error codes on the error stack
[in]severitiesThe list of severities for each of the errors (#EMH_severity_error, #EMH_severity_warning, or #EMH_severity_information).
[in]errorMessagesThe displayable error message for each error.
const std::string& IFail::getMessage ( ) const

Returns a localized message in which all error code parameters have been substituted.

int IFail::ifail ( ) const

Retrieves the associated error code.

IFail::operator int ( ) const

Retrieves the associated error code.

Friends And Related Function Documentation

friend class ResultCheck
friend

Definition at line 123 of file IFail.hxx.

friend class ResultStatus
friend

Definition at line 122 of file IFail.hxx.

Member Data Documentation

int IFail::m_ifail
private

The error code

Definition at line 119 of file IFail.hxx.

std::string IFail::m_message
private

Definition at line 120 of file IFail.hxx.


The documentation for this class was generated from the following file: