mockpp::ThrowableItem Class Reference

A throwable object. More...

List of all members.

Public Member Functions

 ThrowableItem (Throwable *it=0)
 Construct the item.
 ThrowableItem (const ThrowableItem &it)
 Construct the item from another.
ThrowableItemoperator= (const ThrowableItem &it)
 Copy the item from another.
virtual ~ThrowableItem () throw ()
 Destruct the item.
void take (Throwable *it)
 Set the throwable item.
template<class T >
void take (const T &w)
 Set the throwable item.
Throwablerelease ()
 Releases the internal pointer.
Throwableget () const
 Gets the throwable item.
void reset ()
 Sets the object into a clean and unused state.
bool wasUsed () const
 Queries if the throwable object was taken via get().

Detailed Description

A throwable object.

The object is completely managed which also includes the destruction of the object by the destructor of this container. The behaviour when copying is similar to std::auto_ptr<T>: the ownership changes.

Definition at line 136 of file Throwable.h.


Constructor & Destructor Documentation

mockpp::ThrowableItem::ThrowableItem ( Throwable it = 0  ) 

Construct the item.

Parameters:
it pointer to the throwable object

Definition at line 44 of file Throwable.cpp.

mockpp::ThrowableItem::ThrowableItem ( const ThrowableItem it  ) 

Construct the item from another.

Parameters:
it Another object. The internal pointers ownership is moved and the other object loses the object.

Definition at line 51 of file Throwable.cpp.


Member Function Documentation

Throwable * mockpp::ThrowableItem::get (  )  const

Gets the throwable item.

Returns:
pointer to the throwable

Definition at line 85 of file Throwable.cpp.

ThrowableItem & mockpp::ThrowableItem::operator= ( const ThrowableItem it  ) 

Copy the item from another.

Parameters:
it Another object. The internal pointers ownership is moved and the other object loses the object.

Definition at line 57 of file Throwable.cpp.

Throwable * mockpp::ThrowableItem::release (  ) 

Releases the internal pointer.

Returns:
pointer to the throwable

Definition at line 77 of file Throwable.cpp.

template<class T >
void mockpp::ThrowableItem::take ( const T &  w  )  [inline]

Set the throwable item.

Parameters:
w the object to throw

Definition at line 178 of file Throwable.h.

void mockpp::ThrowableItem::take ( Throwable it  ) 

Set the throwable item.

Attention: In case you pass "0" to clear the object, don't forget to cast it to "Throwable", otherwise the template method will be taken!

Parameters:
it pointer to the throwable object

Definition at line 70 of file Throwable.cpp.

bool mockpp::ThrowableItem::wasUsed (  )  const

Queries if the throwable object was taken via get().

There must also be an object set for this being true.

Returns:
true: object was taken at least once

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines

Generated on Tue Jan 5 09:49:00 2010 for mockpp by  doxygen 1.6.1