Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <berryCallHistory.h>
Public Member Functions | |
berryObjectMacro (CallHistory) | |
CallHistory () | |
void | Add (const std::string &methodName) |
void | Clear () |
bool | VerifyOrder (const std::vector< std::string > &testNames) const throw (Poco::InvalidArgumentException) |
bool | Contains (const std::string &methodName) const |
bool | Contains (const std::vector< std::string > &methodNames) const |
bool | IsEmpty () const |
void | PrintTo (std::ostream &out) const |
Public Member Functions inherited from berry::Object | |
virtual QString | GetClassName () const |
virtual Reflection::TypeInfo | GetTypeInfo () const |
virtual QList< Reflection::TypeInfo > | GetSuperclasses () const |
virtual void | Delete () |
QDebug | Print (QDebug os, Indent Indent=0) const |
virtual QString | ToString () const |
virtual uint | HashCode () const |
virtual bool | operator< (const Object *) const |
void | Register () const |
void | UnRegister (bool del=true) const |
int | GetReferenceCount () const |
void | SetReferenceCount (int) |
void | AddDestroyListener (const MessageAbstractDelegate<> &delegate) const |
void | RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const |
virtual bool | operator== (const Object *) const |
Additional Inherited Members | |
Public Types inherited from berry::Object | |
typedef Object | Self |
typedef berry::SmartPointer< Self > | Pointer |
typedef berry::SmartPointer< const Self > | ConstPointer |
typedef berry::WeakPointer< Self > | WeakPtr |
typedef berry::WeakPointer< const Self > | ConstWeakPtr |
Static Public Member Functions inherited from berry::Object | |
static const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
Protected Member Functions inherited from berry::Object | |
Object () | |
virtual | ~Object () |
virtual QDebug | PrintSelf (QDebug os, Indent indent) const |
virtual QDebug | PrintHeader (QDebug os, Indent indent) const |
virtual QDebug | PrintTrailer (QDebug os, Indent indent) const |
Protected Attributes inherited from berry::Object | |
QAtomicInt | m_ReferenceCount |
QMutex | m_ReferenceCountLock |
CallHistory
is used to record the invocation of methods within a target object. This is useful during lifecycle testing for an object.
To use CallHistory
..
Each CallHistory
has a target which is used to verify the method names passed to the history. If an invalid name is passed an IllegalArgumentException
will be thrown.
Definition at line 54 of file berryCallHistory.h.
berry::CallHistory::CallHistory | ( | ) |
Creates a new call history for an object.
target | the call history target. |
Definition at line 24 of file berryCallHistory.cpp.
void berry::CallHistory::Add | ( | const std::string & | methodName | ) |
Adds a method name to the call history.
methodName | the name of a method |
Definition at line 29 of file berryCallHistory.cpp.
berry::CallHistory::berryObjectMacro | ( | CallHistory | ) |
void berry::CallHistory::Clear | ( | ) |
Clears the call history.
Definition at line 35 of file berryCallHistory.cpp.
bool berry::CallHistory::Contains | ( | const std::string & | methodName | ) | const |
Returns whether a method has been called.
methodName | a method name |
true
if the method was called Definition at line 60 of file berryCallHistory.cpp.
bool berry::CallHistory::Contains | ( | const std::vector< std::string > & | methodNames | ) | const |
Returns whether a list of methods were called.
methodNames | a list of methods |
true
if the methods were called Definition at line 66 of file berryCallHistory.cpp.
bool berry::CallHistory::IsEmpty | ( | ) | const |
Returns whether the list of methods called is empty.
true
iff the list of methods is empty Definition at line 77 of file berryCallHistory.cpp.
void berry::CallHistory::PrintTo | ( | std::ostream & | out | ) | const |
Prints the call history to the console.
Definition at line 82 of file berryCallHistory.cpp.
bool berry::CallHistory::VerifyOrder | ( | const std::vector< std::string > & | testNames | ) | const |
throw | ( | Poco::InvalidArgumentException | |||
) |
Returns whether a list of methods have been called in order.
testNames | an array of the method names in the order they are expected |
true
if the methods were called in order Definition at line 40 of file berryCallHistory.cpp.