VISH
0.2
|
A convenience class that can be added as base class to any VObject. More...
#include </home/werner/origo/vish/ocean/shrimp/VObjectStatus.hpp>
A convenience class that can be added as base class to any VObject.
Overload the catchupdate() function here instead of VObject::update(), and throw a simple text as exception to indicate the status of this object, when the update operation has been incomplete.
Wizt::CatchStatus::CatchStatus | ( | const string & | name, |
int | p = 0 , |
||
const RefPtr< VCreationPreferences > & | VP = NullPtr() , |
||
const string & | initialtext = "" , |
||
int | EL = 0 |
||
) | [inline] |
Constructor, most arguments are for constructing the VObject.
Note that if a child class has to initialize the virtual base class VObject anyway, so those parameters here will actually never be used. Most important is the initialtext parameter, which gives the default value of the status text of the object in a new Context.
virtual void Wizt::CatchStatus::catchupdate | ( | VRequest & | Context, |
double | precision | ||
) | [pure virtual] |
Virtual function, performing an update() of the object, and may throw a text of type const char* to indicate the status of this object.
Note that one must not throw a std::string, because this class is not exception safe. Rather, the std::string class may throw exceptions itself, which in an exception handler such as this one will lead to a fatal exception that cannot be caught any more (which means immediate program termination).
bool Wizt::CatchStatus::update | ( | VRequest & | , |
double | precision | ||
) | [virtual] |
Virtual update function that implements some heavy action on the object.
Update function.
It is called only if any input object is newer than the current object. It must return true on successful completion. However, the object may touch() itself in the update() routine. Then, it will get a newer time than all input objects, which will trigger all dependent objects as well.
Reimplemented from Wizt::VObject.