Component Interface

"Vandenbroucke Sander" <[email protected]> Wed, 24 Oct 2007 09:23:18 +0200
Newsgroups gmane.science.robotics.orocos.user
Message-ID <CC092C670C482A4C954AB4D13743B60A045E67A9@vdwmar13.vandewiele.local>
Hi,

Lets say we have a common interface for multiple components.

class IDummyComponent
{
protected:
	RTT::WriteDataPort<int> m_DummyLoad;

	RTT::Property<int> m_MaxLoad

	RTT::Command<bool(void)> m_IncLoad;

	RTT::Event<void(void)> m_Emergency;

	IDummyComponent(TaskContext* Owner) :
		m_DummyLoad("DummyLoad"),
		m_MaxLoad("MaxLoad", "The maximum load", 1024),
		m_IncLoad("IncLoad"),
		m_Emergency("Emergency")
	{
		Owner->ports()->addPort(&m_DummyLoad);
		Owner->properties()->addProperty(&m_MaxLoad);
		Owner->commands()->addCommand(&m_IncLoad);
		Owner->events()->addEvent(&m_Emergency);
	}
}

The addPort and addProperty are no problem, if I want to change
m_DummyLoad's implementation later on I can do so.

The addCommand and addEvent won't work because neither will be ready().
To make them ready means either connecting functions or choose an
alternate implementation.

Here is my question:
How can I add a Command or Event to the interface without choosing an
implementation?
Or is there a way to change the implementation later on?

Sander.

-- 
Orocos mailing list
[email protected]
http://lists.mech.kuleuven.be/mailman/listinfo/orocos

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm