|
xmscore
1.0
|
Class used with the observer pattern. More...
#include <Observer.h>
Classes | |
| class | impl |
| Implementation of the observer class. More... | |
Public Member Functions | |
| bool | ProgressStatus (double a_percentComplete) |
| Method to publish the progress status. More... | |
| void | BeginOperationString (const std::string &a_operation) |
| Publishes the name of the operation and starts the timing of the operation. More... | |
| void | EndOperation () |
| Ends the operation. | |
| void | UpdateMessage (const std::string &a_message) |
| Updates the message but not the percent complete. More... | |
Private Member Functions | |
| virtual void | OnProgressStatus (double a_percentComplete)=0 |
| virtual void | OnBeginOperationString (const std::string &a_operation) |
| Virtual function for derived class to get the operation string. More... | |
| virtual void | OnEndOperation () |
| Virtual function for derived class to get end operation event. | |
| virtual void | OnUpdateMessage (const std::string &a_message) |
| virtual void | TimeRemainingInSeconds (double a_remainingSeconds) |
| Virtual method to publish the time remaining. More... | |
| virtual void | TimeElapsedInSeconds (double a_elapsedSeconds) |
| Virtual method to publish the elasped time. More... | |
Private Attributes | |
| friend | ObserverT |
| testing class | |
| BSHP< impl > | m_p |
| implementation class | |
Class used with the observer pattern.
Definition at line 26 of file Observer.h.
| void xms::Observer::BeginOperationString | ( | const std::string & | a_operation | ) |
Publishes the name of the operation and starts the timing of the operation.
| a_operation | String identifying the name of the operation that is being observed by this class. |
Definition at line 116 of file Observer.cpp.
References m_p, OnBeginOperationString(), and ProgressStatus().
Referenced by ObserverIntermediateTests::testTimeRemaining().
|
privatevirtual |
Virtual function for derived class to get the operation string.
| a_operation | String identifying the name of the operation that is being observed by this class. |
Reimplemented in MockObserver.
Definition at line 144 of file Observer.cpp.
Referenced by BeginOperationString().
|
privatepure virtual |
virtual function to receive the progress status
| [in] | a_percentComplete | Percent complete between 0.0 and 1.0. |
Implemented in MockObserver.
Referenced by ProgressStatus().
|
privatevirtual |
virtual function to be notified that the message has been set
| [in] | a_message | The new message. |
Definition at line 158 of file Observer.cpp.
Referenced by UpdateMessage().
| bool xms::Observer::ProgressStatus | ( | double | a_percentComplete | ) |
Method to publish the progress status.
| a_percentComplete | The percentage complete for the current operation |
Definition at line 78 of file Observer.cpp.
References m_p, OnProgressStatus(), TimeElapsedInSeconds(), and TimeRemainingInSeconds().
Referenced by BeginOperationString(), EndOperation(), and ObserverIntermediateTests::testTimeRemaining().
|
privatevirtual |
Virtual method to publish the elasped time.
| a_elapsedSeconds | The elapsed time since the operation began. |
Reimplemented in MockObserver.
Definition at line 106 of file Observer.cpp.
Referenced by ProgressStatus().
|
privatevirtual |
Virtual method to publish the time remaining.
| a_remainingSeconds | The time remaining for the current operation that the class is observing. |
Reimplemented in MockObserver.
Definition at line 98 of file Observer.cpp.
Referenced by ProgressStatus().
| void xms::Observer::UpdateMessage | ( | const std::string & | a_message | ) |
Updates the message but not the percent complete.
| [in] | a_message | The new message. |
Definition at line 135 of file Observer.cpp.
References OnUpdateMessage().