Passes a value back via a reference (Outbound value). More...
Public Member Functions | |
TriggeredOutbound (const T &retArg) | |
Constructs the object. | |
template<class I > | |
TriggeredOutbound (I items, I end) | |
Constructs the object base on a list of values. | |
void | addOutboundObject (const T &retArg) |
Adds another return value. | |
template<class I > | |
TriggeredOutbound & | addOutboundObject (I items, I end) |
Add a sequence of next objects to the end of the list. | |
virtual | ~TriggeredOutbound () |
Destroys the object. | |
virtual bool | eval (const T &arg) const |
Evaluates the constraint. | |
virtual bool | verify (const T &) const |
Evaluates the constraint at the end. | |
virtual String | describeTo (String &buffer) const |
Appends the description of this object to the buffer. | |
virtual void | trigger () |
Triggers the defered constraint. |
Passes a value back via a reference (Outbound value).
The reference is set in method eval
and filled with the according value in trigger
. The reference is set to zero immediately after using it. For that reason eval
and trigger
always come in pairs to avoid using a dangling pointer from a temporary or deleted variable.
TriggeredOutbound
in conjunction with other contraints using And
or Or
as side effects might occur. Definition at line 53 of file TriggeredOutbound.h.
mockpp::TriggeredOutbound< T >::TriggeredOutbound | ( | const T & | retArg | ) | [inline] |
Constructs the object.
retArg | the first value to return |
Definition at line 60 of file TriggeredOutbound.h.
mockpp::TriggeredOutbound< T >::TriggeredOutbound | ( | I | items, | |
I | end | |||
) | [inline] |
Constructs the object base on a list of values.
items | start iterator | |
end | terminating iterator (note: one element "behind" as always with STL) |
Definition at line 72 of file TriggeredOutbound.h.
TriggeredOutbound& mockpp::TriggeredOutbound< T >::addOutboundObject | ( | I | items, | |
I | end | |||
) | [inline] |
Add a sequence of next objects to the end of the list.
items | start iterator | |
end | terminating iterator (note: one element "behind" as always with STL) |
Definition at line 93 of file TriggeredOutbound.h.
void mockpp::TriggeredOutbound< T >::addOutboundObject | ( | const T & | retArg | ) | [inline] |
Adds another return value.
retArg | the next value to return |
Definition at line 82 of file TriggeredOutbound.h.
virtual String mockpp::TriggeredOutbound< T >::describeTo | ( | String & | buffer | ) | const [inline, virtual] |
Appends the description of this object to the buffer.
buffer | The buffer that the description is appended to. |
Implements mockpp::SelfDescribing.
Definition at line 130 of file TriggeredOutbound.h.
virtual bool mockpp::TriggeredOutbound< T >::eval | ( | const T & | arg | ) | const [inline, virtual] |
Evaluates the constraint.
The value is not actually evaluated but the adresse is stored for later use.
arg | the object which is to pass the value later with trigger() . |
true
Implements mockpp::Constraint< T >.
Definition at line 110 of file TriggeredOutbound.h.
virtual void mockpp::TriggeredOutbound< T >::trigger | ( | ) | [inline, virtual] |
Triggers the defered constraint.
Stores the next available object into the variable.
Implements mockpp::TriggeredConstraint< T >.
Definition at line 141 of file TriggeredOutbound.h.
virtual bool mockpp::TriggeredOutbound< T >::verify | ( | const T & | ) | const [inline, virtual] |
Evaluates the constraint at the end.
arg | the object which is passed the value. |
Reimplemented from mockpp::Constraint< T >.
Definition at line 121 of file TriggeredOutbound.h.