Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkVisitorDispatcher.h File Reference

Go to the source code of this file.

Namespaces

namespace  itk
namespace  itk::fem

Functions

*****Since this code is the
same for all derived element
you should *probably put it
in the macro **Register each
visitor class with the VisitorDispatcher
class before it *is called
This is done by calling the
member function RegisterVisitor
*of the VisitorDispatcher
class and providing the pointer
to the Visitor *function that
performs the required task
The visitor function must
be *declared according to
the VisitFunctionPointerType
template parameter **ReturnType 
MyVisitor_Function (...)
*class VisitorDispatcher
*brief This class provides
the functionality needed to
apply the correct *visitor
function to object of some
class The specific visitor
*function is based on a given
pointer to some object **A
visitor function is a that
can perform various operations
on *objects of various classes
Usually we want this operation
applied on *any of the polymorphic
derived classes The specific
operation is *defined in visitor
functions **For is called
the *visitor function A specific
version of this function must
be defined *for each on which
you want the perform the 
operation (Area(Circle *);*Area(Square *);...).**Now suppose that you want different operations performed on the shape *objects.Which operation will be performed is specified by the class of *the Visitor object.If the Visitor object is of class Area

Variables

*class VisitorDispatcher
*brief This class provides
the functionality needed to
apply the correct *visitor
function to object of some
class The specific visitor
*function is 
choosen
*class VisitorDispatcher
*brief This class provides
the functionality needed to
apply the correct *visitor
function to object of some
class The specific visitor
*function is based on a given
pointer to some object **A
visitor function is a that
can perform various operations
on *objects of various classes
Usually we want this operation
applied on *any of the polymorphic
derived classes The specific
operation is *defined in visitor
functions **For is called
the *visitor function A specific
version of this function must
be defined *for each on which
you want the perform the then
the *area of objects will
be calculated If the visitor
is object of class Circumference
then the circumference of
the shapes will be calculated
**In order to be able to do
that and provide the framework
to easily add *new Visitor
as well as Visited 
classes
*class VisitorDispatcher
*brief This class provides
the functionality needed to
apply the correct *visitor
function to object of some
class The specific visitor
*function is based on a given
pointer to some object **A
visitor function is a that
can perform various operations
on *objects of various classes
Usually we want this operation
applied on *any of the polymorphic
derived classes The specific
operation is *defined in visitor
functions **For is called
the *visitor function A specific
version of this function must
be defined *for each on which
you want the perform the then
the *area of objects will
be calculated If the visitor
is object of class Circumference
then the circumference of
the shapes will be calculated
**In order to be able to do
that and provide the framework
to easily add *new Visitor
as well as Visited we create
the VisitorDispatcher *class
It is implemented as a singelton
It stores pointers to Visitor
*functions together with the
information about which Visitor
function must *be called in
order to perform an operation
specified by Visitor class
on *objects of Visited class
**To make a specific base
class and all its derived
classes visitable you *must
make the following changes
to your 
code
***Once all this is done
*class VisitorDispatcher
*brief This class provides
the functionality needed to
apply the correct *visitor
function to object of some
class The specific visitor
*function is based on a given
pointer to some object **A
visitor function is a that
can perform various operations
on *objects of various classes
Usually we want this operation
applied on *any of the polymorphic
derived classes The specific
operation is *defined in visitor
functions **For 
example
***The Visitor class is templated
over several classes that
make its use *generic and
simple **TVisitedClass Class
of objects that will be visited
**TVisitorBase Base class
of Visitor objects Objects
of class *TVisitedClass will
be visited by object of any
*registered class that is
derived from TVisitorBase
**TVisitFunctionPointerType
Type of visit functions Visitor
dispatcher *stores an array
of pointers to these functions
Default *function pointer
type is provided **note Template
parameter TVisitFunctionPointerType
in general doesn t *have to
be a pointer to function In 
fact
*class VisitorDispatcher
*brief This class provides
the functionality needed to
apply the correct *visitor
function to object of some
class The specific visitor
*function is based on a given
pointer to some object **A
visitor function is
function
***The Visitor class is templated
over several classes that
make its use *generic and
simple **TVisitedClass Class
of objects that will be visited
**TVisitorBase Base class
of Visitor objects Objects
of class *TVisitedClass will
be visited by object of any
*registered class that is
derived from TVisitorBase
**TVisitFunctionPointerType
Type of visit functions Visitor
dispatcher *stores an array
of pointers to these functions
Default *function pointer
type is provided **note Template
parameter TVisitFunctionPointerType
in general doesn t *have to
be a pointer to function In
it can be any type *Object
of this type will be 
returned
****Implement this function
in ALL derived classes like 
VisitorBase


Function Documentation

* * * * * Since this code is the same for all derived element you should* probably put it in the macro* * Register each visitor class with the VisitorDispatcher class before it* is called This is done by calling the member function RegisterVisitor* of the VisitorDispatcher class and providing the pointer to the Visitor* function that performs the required task The visitor function must be* declared according to the VisitFunctionPointerType template parameter* * ReturnType itk::fem::MyVisitor_Function   ...  ) 
 

* class VisitorDispatcher* brief This class provides the functionality needed to apply the correct* visitor function to object of some class The specific visitor* function is based on a given pointer to some object* * A visitor function is a that can perform various operations on* objects of various classes Usually we want this operation applied on* any of the polymorphic derived classes The specific operation is* defined in visitor functions* * For is called the* visitor function A specific version of this function must be defined* for each on which you want the perform the itk::fem::operation Area(Circle *);*Area(Square *);  ...  ) 
 


Variable Documentation

* class VisitorDispatcher* brief This class provides the functionality needed to apply the correct* visitor function to object of some class The specific visitor* function is itk::fem::choosen
 

Definition at line 42 of file itkVisitorDispatcher.h.

*****Since this code is the same for all derived element itk::fem::classes
 

Definition at line 92 of file itkVisitorDispatcher.h.

* class VisitorDispatcher* brief This class provides the functionality needed to apply the correct* visitor function to object of some class The specific visitor* function is based on a given pointer to some object* * A visitor function is a that can perform various operations on* objects of various classes Usually we want this operation applied on* any of the polymorphic derived classes The specific operation is* defined in visitor functions* * For is called the* visitor function A specific version of this function must be defined* for each on which you want the perform the then the* area of objects will be calculated If the visitor is object of class Circumference then the circumference of the shapes will be calculated* * In order to be able to do that and provide the framework to easily add* new Visitor as well as Visited we create the VisitorDispatcher* class It is implemented as a singelton It stores pointers to Visitor* functions together with the information about which Visitor function must* be called in order to perform an operation specified by Visitor class on* objects of Visited class* * To make a specific base class and all its derived classes visitable you* must make the following changes to your itk::fem::code
 

Definition at line 70 of file itkVisitorDispatcher.h.

* * * Once all this is itk::fem::done
 

Definition at line 106 of file itkVisitorDispatcher.h.

Referenced by itk::ImageRegionReverseConstIterator< TImage >::operator++(), and itk::ImageRegionReverseConstIterator< TImage >::operator--().

* class VisitorDispatcher* brief This class provides the functionality needed to apply the correct* visitor function to object of some class The specific visitor* function is based on a given pointer to some object* * A visitor function is a that can perform various operations on* objects of various classes Usually we want this operation applied on* any of the polymorphic derived classes The specific operation is* defined in visitor functions* * For itk::fem::example
 

Definition at line 42 of file itkVisitorDispatcher.h.

* * * The Visitor class is templated over several classes that make its use* generic and simple* * TVisitedClass Class of objects that will be visited* * TVisitorBase Base class of Visitor objects Objects of class* TVisitedClass will be visited by object of any* registered class that is derived from TVisitorBase* * TVisitFunctionPointerType Type of visit functions Visitor dispatcher* stores an array of pointers to these functions Default* function pointer type is provided* * note Template parameter TVisitFunctionPointerType in general doesn t* have to be a pointer to function In itk::fem::fact
 

Definition at line 120 of file itkVisitorDispatcher.h.

* class VisitorDispatcher* brief This class provides the functionality needed to apply the correct* visitor function to object of some class The specific visitor* function is based on a given pointer to some object* * A visitor function is a itk::fem::function
 

Definition at line 42 of file itkVisitorDispatcher.h.

* * * The Visitor class is templated over several classes that make its use* generic and simple* * TVisitedClass Class of objects that will be visited* * TVisitorBase Base class of Visitor objects Objects of class* TVisitedClass will be visited by object of any* registered class that is derived from TVisitorBase* * TVisitFunctionPointerType Type of visit functions Visitor dispatcher* stores an array of pointers to these functions Default* function pointer type is provided* * note Template parameter TVisitFunctionPointerType in general doesn t* have to be a pointer to function In it can be any type* Object of this type will be itk::fem::returned
 

Definition at line 120 of file itkVisitorDispatcher.h.

* * * * Implement this function in ALL derived classes like itk::fem::VisitorBase
 

Definition at line 80 of file itkVisitorDispatcher.h.


Generated at Sun Jul 9 18:46:17 2006 for ITK by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2000