A list of throwable objects. More...
Public Member Functions | |
ThrowableList (const String &aName, VerifiableList *parent) | |
Construct a new empty list. | |
virtual | ~ThrowableList () throw () |
Destruct the list. | |
void | push_back (Throwable *t) |
Add a next object to the end of the list. | |
void | addObjectToThrow (Throwable *t) |
Add a next object to the end of the list. | |
template<class T > | |
void | push_back (const T &w) |
Add a next object to the end of the list. | |
template<class T > | |
void | addObjectToThrow (const T &w) |
Add a next object to the end of the list. | |
Throwable * | nextThrowableObject () |
Returns the next object from the list. | |
bool | hasMoreObjects () const |
Returns true if there are more objects to be returned. | |
Throwable * | at (unsigned i) |
Returns a pointer to the specified object in the list. | |
virtual void | verify () |
Verify that there are no objects left within the list. | |
virtual void | reset () |
Sets all internal objects to the state after construction. | |
unsigned | size () const |
Returns the amount of response values. |
A list of throwable objects.
The objects are completely managed which also includes the destruction of the objects by the destructor of this list.
Definition at line 48 of file ThrowableList.h.
mockpp::ThrowableList::ThrowableList | ( | const String & | aName, | |
VerifiableList * | parent | |||
) |
Construct a new empty list.
aName | Label used to identify list | |
parent | parent verifiable |
Definition at line 41 of file ThrowableList.cpp.
void mockpp::ThrowableList::addObjectToThrow | ( | const T & | w | ) | [inline] |
Add a next object to the end of the list.
The objects remains from now on in the responsibiliy of this list until the list itself is destroyed! This is valid even for objects taken via nextThrowableObject()!
w | object to be added to the list |
Definition at line 101 of file ThrowableList.h.
void mockpp::ThrowableList::addObjectToThrow | ( | Throwable * | t | ) |
Add a next object to the end of the list.
The objects remains from now on in the responsibiliy of this list until the list itself is destroyed! This is valid even for objects taken via nextThrowableObject()! Don't add the same object (the same pointer!) more than once via this method.
t | pointer to object to be added to the list |
Definition at line 59 of file ThrowableList.cpp.
Throwable * mockpp::ThrowableList::at | ( | unsigned | i | ) |
Returns a pointer to the specified object in the list.
The list is not changed!
i | index of the object |
Definition at line 73 of file ThrowableList.cpp.
Throwable * mockpp::ThrowableList::nextThrowableObject | ( | ) |
Returns the next object from the list.
Each object it returned in the order in which they where added.
Definition at line 89 of file ThrowableList.cpp.
void mockpp::ThrowableList::push_back | ( | const T & | w | ) | [inline] |
Add a next object to the end of the list.
The objects remains from now on in the responsibiliy of this list until the list itself is destroyed! This is valid even for objects taken via nextThrowableObject()!
w | object to be added to the list |
Definition at line 89 of file ThrowableList.h.
void mockpp::ThrowableList::push_back | ( | Throwable * | t | ) |
Add a next object to the end of the list.
The objects remains from now on in the responsibiliy of this list until the list itself is destroyed! This is valid even for objects taken via nextThrowableObject()! Don't add the same object (the same pointer!) more than once via this method.
t | pointer to object to be added to the list |
Definition at line 53 of file ThrowableList.cpp.
unsigned mockpp::ThrowableList::size | ( | ) | const |
Returns the amount of response values.
The count covers already used and still unused obbjects!
Definition at line 67 of file ThrowableList.cpp.
void mockpp::ThrowableList::verify | ( | ) | [virtual] |
Verify that there are no objects left within the list.
If it fails, an AssertionFailedError is thrown
Implements mockpp::Verifiable.
Definition at line 121 of file ThrowableList.cpp.