logo
Published on The Orocos Project (http://www.orocos.org)

Wierd template problem.

By Vandenbroucke Sander
Created 2008-05-07 11:24

Hi,

I have a template wrapper class around RTT::Event:

template<SignatureT>
class MyEvent : public RTT::Event<SignatureT>
{

	....
	bool connect(const std::string& Component, const std::string&

Event, boost::function<SignatureT> const& SyncFun);
}

template<typename SignatureT>
bool VDWEvent<SignatureT>::connect(const std::string& Component, const
std::string& Event, boost::function<SignatureT> const& SyncFun)
{

	VDWTaskContext* p_comp = VDWTaskContext::nameserver()->

getObject(Component);

	if(p_comp)
	{
		VDWEvent<SignatureT> event(p_comp->events()->

getEvent<SignatureT>(Event));

		event.connect(SyncFun);
	}
	else
	{
		RTT::Logger::In in("VDWEvent::connect");
		RTT::log(RTT::Error) << "Could not connect to event " <<

Event << ", " << "component " << Component << " not
found." << RTT::endlog();

		return false;
	}
	return true;

}

When compiling I get an error on line:
VDWEvent<SignatureT>
event(p_comp->events()->getEvent<SignatureT>(Event));

'error: expected primary-expression before '>' token'

I don't have a clue...

In EventService.hpp getEvent is declared as follows:

template<class Signature>
boost::shared_ptr<ActionInterface> getEvent(const std::string& ename)
{

	if ( mevents.count(ename) )
      	return mevents[ename];
	return boost::shared_ptr<ActionInterface>();

}

When removing the template<class Signature> all compiles just fine.

Sander.


‹ [Bug 541] New: error in installation manual [Bug 540] New: chainiksolvervel_pinv not suitable for redundant chains ›

Source URL:
http://www.orocos.org/node/665