Why do you instantly I don''t know what I''m doing? No, I''m not trying to protect me from myself, I''m trying to protect my application framework from self-distructing. Because this controller device is just another device, it will be activated just like any other. But this one''s activate function is only used to redirect activation to another device. Thus if it is activated directly, it will try to activate itself, over and over and over. All the other devices call the activate function of the controller device when they wish to be activated. This isn''t the issue at all... I just need something akin to type checking or dynamic cast. Would my pseudocode above work? I can''t see a way of testing whether it works or not...
--------------------
You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor
RTTI broke my project?
If you don''t have RTTI then just emulate it by having a virtual member function that returns a boolean describing whether that controller can process messages. In the base class it can be marked true and in that one class you can mark it false. This is kind of like a type field, which is another way of doing it.
Hope that helps!
Hope that helps!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement