[IGSTK-Developers] Re: Accessing StateMachine from derived classes

Luis Ibanez luis.ibanez at kitware.com
Thu Mar 9 10:23:04 EST 2006



Hi Julien,


              State Machines are private.


In order to preserve the encapsulation of the logic, it is fundamental
that derived (nor other classes) have access to the State, nor the
action methods (the ones ending in "Processing")


Derived classes can interact with state machines of base classes
via the two following mechanisms:


1) Polymorphism:  by overloading virtual methods in the base class.


2) Invoking Request methods: just as any other external class.


Method (1) is dangerous and must be used with caution. The overloading
functions *must* follow the OOP directive of invoking the equivalent
method in the base class.



Are you dealing with a particularly difficult case ?



     Luis



------------------------
Julien Jomier wrote:
> Hi Luis,
> 
> I know we talked about it a long time ago and I'm sorry I don't recall 
> the answer but is there a way to access the superclass state machine 
> from derived classes?
> It's not critical for what I'm implementing but I am just wondering if 
> it is possible with the current implementation.
> 
> Thanks for the help,
> 
> Julien
> 
> 
> 




More information about the IGSTK-Developers mailing list