Teamcenter C++ API Reference  2312
Public Member Functions | List of all members
ResultCheck Class Reference

A ResultStatus instance is a temporary object to which both error codes and instances status_t can be assigned.
If, once such has been assigned, the result turns out to be a failure, the class will throw an IFail using the last error on the error stack. More...

#include <ResultCheck.hxx>

Public Member Functions

ResultCheckoperator= (const int ifail)
 
 ResultCheck ()
 
 ResultCheck (const int ifail)
 
virtual ~ResultCheck ()
 

Detailed Description

A ResultStatus instance is a temporary object to which both error codes and instances status_t can be assigned.
If, once such has been assigned, the result turns out to be a failure, the class will throw an IFail using the last error on the error stack.

try
{
//NOTE: No need to check what calls have returned.
// If this is an error, the ResultStatus class will ensure that an exception is thrown.
ok = callSomeFunction_ReturningAnErrorCode();
ok = callSomeOtherFunction_ReturningAnErrorCode();
[...]
}
catch ( const IFail& ifail )
{
//Handle the exception here
[...]
}
Note
Prefer usage of ResultStatus, since it can handle both error codes and status_t.

Definition at line 46 of file ResultCheck.hxx.

Constructor & Destructor Documentation

ResultCheck::ResultCheck ( )

Default constructor.

ResultCheck::ResultCheck ( const int  ifail)

Constructs a ResultCheck object from an error code.
If the error code is not ITK_ok, an IFail exception will be thrown.

Note
It is expected that the matching error is already on the top of the error stack prior to this call.
virtual ResultCheck::~ResultCheck ( )
virtual

Destructor

Member Function Documentation

ResultCheck& ResultCheck::operator= ( const int  ifail)

Operator = Throws an IFail exception if the error code in the parameter ifail is not ITK_ok.

Note
It is expected that the matching error is already on the top of the error stack prior to this call.

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