Skip to content

Stateful classes out of component

Tamas Borbas edited this page Aug 25, 2015 · 6 revisions

How can stateful class work if it is not contained in a component

Try out in c++ how can stateful classes can work if not contained in a component.

Possible solutions

1. Global component for classes which are not contained in any component

GlobalComponent_main.hh:

#ifndef __PINGPONGOUTER__GLOBALCOMPONENT_MAIN_HEADER
#define __PINGPONGOUTER__GLOBALCOMPONENT_MAIN_HEADER

#include "Runtime/ActiveComponent.hh"

namespace PingPongOuter{
class GlobalComponent : public ActiveComponent {
public:
	GlobalComponent(){}
private:
	GlobalComponent(const GlobalComponent&);
	GlobalComponent& operator=(const GlobalComponent&);
};
}

#endif

GlobalComponent_main.cc:

#include "PingPongOuter/GlobalComponent_main.hh"

Example model: PingPongOuter

Clone this wiki locally