You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
1.6 KiB
79 lines
1.6 KiB
// ==================================================
|
|
// Copyright 2013.
|
|
// Siemens Product Lifecycle Management Software Inc.
|
|
// All Rights Reserved.
|
|
// ==================================================
|
|
|
|
#ifndef FCLASSES_MARKPOINT_HXX
|
|
#define FCLASSES_MARKPOINT_HXX
|
|
|
|
/**
|
|
@file
|
|
|
|
Manages markpoint for POM rollback mechanism.
|
|
*/
|
|
|
|
#include <fclasses/libfclasses_exports.h>
|
|
namespace Teamcenter
|
|
{
|
|
/**
|
|
@brief Manages markpoint for POM rollback mechanism.
|
|
|
|
Use as follows:
|
|
@code
|
|
{
|
|
Markpoint markpoint; // Place a POM markpoint.
|
|
|
|
if ( someCall() != OK )
|
|
{
|
|
return NOT_OK; // Destructor automatically rolls back (unless forget has been called).
|
|
}
|
|
|
|
markpoint.forget(); // Forget the markpoint - now destructor will not roll back.
|
|
return OK;
|
|
}
|
|
@endcode
|
|
*/
|
|
class FCLASSES_API Markpoint
|
|
{
|
|
public:
|
|
/**
|
|
Constructor.
|
|
<br/>It places a POM markpoint for POM rollback.
|
|
*/
|
|
Markpoint();
|
|
|
|
/**
|
|
Destructor.
|
|
<br/>It automatically rolls back to the POM markpoint.
|
|
*/
|
|
virtual ~Markpoint();
|
|
|
|
/**
|
|
Forgets the previous markpoint.
|
|
<br/>Once the markpoint is forgotten, the destructor cannot rollback anymore.
|
|
*/
|
|
void forget();
|
|
|
|
private:
|
|
/**
|
|
Copy constructor.
|
|
*/
|
|
Markpoint( const Markpoint& other );
|
|
|
|
/**
|
|
Assignment operator.
|
|
*/
|
|
Markpoint& operator=( const Markpoint& other );
|
|
|
|
/** The markpoint ID. */
|
|
int m_pomMarkpoint;
|
|
|
|
/** Indicates if the markpoint is forgotten. */
|
|
bool m_forgotten;
|
|
};
|
|
}
|
|
|
|
#include <fclasses/libfclasses_undef.h>
|
|
#endif
|