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

A convenient wrapper for setting/clearing a protect mark on the error stack. More...

#include <ErrorStoreProtector.hxx>

Public Member Functions

void clear ()
 
 ErrorStoreProtector ()
 
void forget ()
 
int getProtectMark ()
 
void remember ()
 
virtual ~ErrorStoreProtector ()
 

Static Public Member Functions

static bool isActive ()
 
static void storeErrorLogMsg (const std::string errorLog)
 

Private Member Functions

 ErrorStoreProtector (const ErrorStoreProtector &other)
 
ErrorStoreProtectoroperator= (const ErrorStoreProtector &other)
 

Private Attributes

bool m_cleared
 
int m_errorStoreMarkpoint
 
bool m_forgotten
 

Static Private Attributes

static unsigned int s_count
 
static std::vector
< std::vector< std::string > > 
s_errorMsgsStored
 

Detailed Description

A convenient wrapper for setting/clearing a protect mark on the error stack.

In Teamcenter, all errors are posted to a single central stack of errors.
An error on the stack consists of an integer error code, a severity and zero or more strings that go into the error message.

This class is a convenient wrapper for setting/clearing a protect mark on the error stack, useful for when one wants to assert that there is other processing and any errors that might occur shall be ignored.

Note
The following points needs to be considered whether to return OK rather than NOT_OK when within the scope of an ErrorStoreProtector:
//{ } scope is added intentionally to clear from error stack the errors
//added by the functions called within this cope.
{
ErrorStoreProtector ignoreErrors;
Function1();
Function2();
}

Definition at line 49 of file ErrorStoreProtector.hxx.

Constructor & Destructor Documentation

ErrorStoreProtector::ErrorStoreProtector ( )

Constructor
The constructor function sets a protect mark on the error stack.

virtual ErrorStoreProtector::~ErrorStoreProtector ( )
virtual

Default destructor.
The constructor function clears the error stack from the protect mark.

ErrorStoreProtector::ErrorStoreProtector ( const ErrorStoreProtector other)
private

Private default constructor

Member Function Documentation

void ErrorStoreProtector::clear ( )

Clears a protect mark on the error stack.

void ErrorStoreProtector::forget ( )

Forgets the protect mark and error stack will not be cleared.

int ErrorStoreProtector::getProtectMark ( )

Returns the protect mark.

static bool ErrorStoreProtector::isActive ( )
static

Checks if ErrorStoreProtector is currently active or not.

ErrorStoreProtector& ErrorStoreProtector::operator= ( const ErrorStoreProtector other)
private

Copy constructor

void ErrorStoreProtector::remember ( )

Remembers the protect mark and error stack will be cleared.

static void ErrorStoreProtector::storeErrorLogMsg ( const std::string  errorLog)
static

Adds the ERROR log msg which is created during ESP is active to the buffer

Member Data Documentation

bool ErrorStoreProtector::m_cleared
private

Definition at line 113 of file ErrorStoreProtector.hxx.

int ErrorStoreProtector::m_errorStoreMarkpoint
private

The protect mark

Definition at line 110 of file ErrorStoreProtector.hxx.

bool ErrorStoreProtector::m_forgotten
private

Definition at line 112 of file ErrorStoreProtector.hxx.

unsigned int ErrorStoreProtector::s_count
staticprivate

Maintains the number of ErrorStoreProtector instances.
This is leveraged by isActive().

Definition at line 119 of file ErrorStoreProtector.hxx.

std::vector< std::vector<std::string> > ErrorStoreProtector::s_errorMsgsStored
staticprivate

Definition at line 122 of file ErrorStoreProtector.hxx.


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