Teamcenter C++ API Reference  2312
Public Member Functions | List of all members
ResultStatus 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 <TcResultStatus.hxx>

Public Member Functions

ResultStatusoperator= (const status_t &result)
 
ResultStatusoperator= (const int ifail)
 
 ResultStatus ()
 
 ResultStatus (const status_t &iStatusT)
 
 ResultStatus (const int ifail)
 
virtual ~ResultStatus ()
 

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_ReturningAStatusT();
[...]
}
catch ( const IFail& ifail )
{
//Handle the exception here
[...]
}

Definition at line 44 of file TcResultStatus.hxx.

Constructor & Destructor Documentation

ResultStatus::ResultStatus ( )

Default constructor.

ResultStatus::ResultStatus ( const status_t iStatusT)

Constructs a ResultStatus object from a status_t instance.
If the input instance is not 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.
ResultStatus::ResultStatus ( const int  ifail)

Constructs a ResultStatus 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 ResultStatus::~ResultStatus ( )
virtual

Destructor

Member Function Documentation

ResultStatus& ResultStatus::operator= ( const status_t result)

Operator = Throws an IFail exception if the parameter result is not OK.

Note
It is expected that the matching error is already on the top of the error stack prior to this call.
ResultStatus& ResultStatus::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: