#include <gen.h>


Public Member Functions | |
| a2dWalkerIOHandler () | |
| constructor | |
| ~a2dWalkerIOHandler () | |
| destructor | |
| virtual void | Initialize () |
| to initialize a walker class, default does nothing. | |
| wxString | GetErrorString () |
| get this when an error occured. | |
| void | SetStopWalking (bool stopWalking) |
| to further recursion, e.g. in a2dObject::Walker() | |
| bool | GetStopWalking () |
| check for stop | |
| void | IncCurrentDepth () |
| Increment recursion depth. | |
| void | DecCurrentDepth () |
| Decrement recursion depth. | |
| int | GetCurrentDepth () |
| What is the current recursion depth. | |
| void | SetDepthFirst (bool depthFirst) |
| set if walker needs to go into recursive objects first. | |
| bool | GetDepthFirst () |
| What is the current recursion depth. | |
| void | SetUseCheck (bool useCheck) |
| set if walker needs to check objects for a2dObject::m_check set, before walking into it | |
| bool | GetUseCheck () |
| see SetUseCheck | |
| void | Register (const wxString &classname, a2dObjectIOFn *IOfunc) |
| to register a function to handle a class | |
| void | Unregister (const wxString &classname) |
| to Un-register a function to handle a class | |
| virtual bool | WalkTask (wxObject *parent, wxObject *object, a2dWalkEvent event) |
| called from within a2dObject's and derived classes | |
| wxObject * | GetParent () |
| bool | GetResult () |
| depending upon derived class implementation. | |
Protected Attributes | |
| bool | m_result |
| result of walk, set false at start, use at will. | |
| wxObject * | m_currentParent |
| parent object of current object | |
| wxString | m_error |
| to store errors | |
| bool | m_stopWalking |
| quit the iteration | |
| int | m_currentDepth |
| contour to be used by algorithm, to decide on how deep recursing is to be. | |
| bool | m_depthFirst |
| bool | m_useCheck |
| if set a2dObject are only walked if not m_check is set | |
| a2dIOHandlerCoupleHash | m_register |
| coupling function to event and classname | |
It can be used in combination with a file for reading or writing.
Calling a2dObject::Walker( a2dWalkerIOHandler& handler ), will have the a2dObject start calling the function WalkTask() at predifined moments. The a2dCanvasObject will also recursively go into its children. While a2dPropObject goes into its properties. In a derived class you can define what needs to happen in each WalkTask().
This makes it possible to write algorithm on a a2dDocument, without extending the a2dObject derived classes itself. For instance calculating the area occupied by all a2dCanvasObject, can be implemented with this class.
The default WalkTask() function, checks if a function is registrated for the specific class, and if so calls that function.
Definition at line 3255 of file gen.h.
| bool a2dWalkerIOHandler::WalkTask | ( | wxObject * | parent, | |
| wxObject * | object, | |||
| a2dWalkEvent | event | |||
| ) | [virtual] |
called from within a2dObject's and derived classes
The object which are walked over/into, can announce specific events within that object to the a2dWalkerIOHandler at hand. The a2dWalkerIOHandler can react to those events.
Reimplemented in a2dDumpWalker, a2dWalker_CallMemberFunc, a2dWalker_CallMemberFuncW, a2dWalker_SetAvailable, a2dWalker_RemoveProperty, a2dWalker_RemovePropertyCandoc, a2dWalker_CollectCanvasObjects, a2dWalker_FindCanvasObject, a2dWalker_SetSpecificFlagsCanvasObjects, a2dWalker_SetPropertyToObject, a2dWalker_SetProperty< basetype, a2dpropertyidtyped, proptype >, a2dWalker_SetViewDependent, a2dWalker_SetCanvasDocument, a2dWalker_MakeTree, a2dWalker_RemoveHierarchy, a2dWalker_LayerCanvasObjects, a2dWalker_DetectSmall, a2dWalker_DetectSmallSegments, a2dWalker_FindAndSetCorridorPath, a2dWalker_AllowedObjects, and a2dBooleanWalkerHandler.
| wxObject* a2dWalkerIOHandler::GetParent | ( | ) | [inline] |
if set by walker in WalkTask(), it can be used in child object to get to the parent via the a2dWalkerIOHandler, which is the argument to a child member function.
bool a2dWalkerIOHandler::m_depthFirst [protected] |