| 31 | class StateMachine; |
| 32 | |
| 33 | class CommitCtx |
| 34 | { |
| 35 | public: |
| 36 | CommitCtx(Config * poConfig); |
| 37 | ~CommitCtx(); |
| 38 | |
| 39 | void NewCommit(std::string * psValue, SMCtx * poSMCtx, const int iTimeoutMs); |
| 40 | |
| 41 | const bool IsNewCommit() const; |
| 42 | |
| 43 | std::string & GetCommitValue(); |
| 44 | |
| 45 | void StartCommit(const uint64_t llInstanceID); |
| 46 | |
| 47 | bool IsMyCommit(const uint64_t llInstanceID, const std::string & sLearnValue, SMCtx *& poSMCtx); |
| 48 | |
| 49 | public: |
| 50 | void SetResult(const int iCommitRet, const uint64_t llInstanceID, const std::string & sLearnValue); |
| 51 | |
| 52 | void SetResultOnlyRet(const int iCommitRet); |
| 53 | |
| 54 | int GetResult(uint64_t & llSuccInstanceID); |
| 55 | |
| 56 | public: |
| 57 | const int GetTimeoutMs() const; |
| 58 | |
| 59 | private: |
| 60 | Config * m_poConfig; |
| 61 | |
| 62 | uint64_t m_llInstanceID; |
| 63 | int m_iCommitRet; |
| 64 | bool m_bIsCommitEnd; |
| 65 | int m_iTimeoutMs; |
| 66 | |
| 67 | std::string * m_psValue; |
| 68 | SMCtx * m_poSMCtx; |
| 69 | SerialLock m_oSerialLock; |
| 70 | }; |
| 71 | } |
nothing calls this directly
no outgoing calls
no test coverage detected