xmscore  1.0
xms::Observer Class Referenceabstract

Class used with the observer pattern. More...

#include <Observer.h>

Inheritance diagram for xms::Observer:
MockObserver

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< implm_p
 implementation class
 

Detailed Description

Class used with the observer pattern.

Definition at line 26 of file Observer.h.

Member Function Documentation

◆ BeginOperationString()

void xms::Observer::BeginOperationString ( const std::string &  a_operation)

Publishes the name of the operation and starts the timing of the operation.

Parameters
a_operationString 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().

◆ OnBeginOperationString()

void xms::Observer::OnBeginOperationString ( const std::string &  a_operation)
privatevirtual

Virtual function for derived class to get the operation string.

Parameters
a_operationString 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().

◆ OnProgressStatus()

virtual void xms::Observer::OnProgressStatus ( double  a_percentComplete)
privatepure virtual

virtual function to receive the progress status

Parameters
[in]a_percentCompletePercent complete between 0.0 and 1.0.

Implemented in MockObserver.

Referenced by ProgressStatus().

◆ OnUpdateMessage()

void xms::Observer::OnUpdateMessage ( const std::string &  a_message)
privatevirtual

virtual function to be notified that the message has been set

Parameters
[in]a_messageThe new message.

Definition at line 158 of file Observer.cpp.

Referenced by UpdateMessage().

◆ ProgressStatus()

bool xms::Observer::ProgressStatus ( double  a_percentComplete)

Method to publish the progress status.

Parameters
a_percentCompleteThe percentage complete for the current operation
Returns
returns whether the ProgressBar actually updates.

Definition at line 78 of file Observer.cpp.

References m_p, OnProgressStatus(), TimeElapsedInSeconds(), and TimeRemainingInSeconds().

Referenced by BeginOperationString(), EndOperation(), and ObserverIntermediateTests::testTimeRemaining().

◆ TimeElapsedInSeconds()

void xms::Observer::TimeElapsedInSeconds ( double  a_elapsedSeconds)
privatevirtual

Virtual method to publish the elasped time.

Parameters
a_elapsedSecondsThe elapsed time since the operation began.

Reimplemented in MockObserver.

Definition at line 106 of file Observer.cpp.

Referenced by ProgressStatus().

◆ TimeRemainingInSeconds()

void xms::Observer::TimeRemainingInSeconds ( double  a_remainingSeconds)
privatevirtual

Virtual method to publish the time remaining.

Parameters
a_remainingSecondsThe 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().

◆ UpdateMessage()

void xms::Observer::UpdateMessage ( const std::string &  a_message)

Updates the message but not the percent complete.

Parameters
[in]a_messageThe new message.

Definition at line 135 of file Observer.cpp.

References OnUpdateMessage().


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