// ================================================== // 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 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.
It places a POM markpoint for POM rollback. */ Markpoint(); /** Destructor.
It automatically rolls back to the POM markpoint. */ virtual ~Markpoint(); /** Forgets the previous markpoint.
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 #endif