void Core::subscribeToProperty(VehicleProperty::Property property, AbstractSink* self)
{
- propertySinkMap[property].push_back(self);
+ SinkList list = propertySinkMap[property];
+
+ if(!ListPlusPlus<AbstractSink*>(&list).contains(self))
+ {
+ list.push_back(self);
+ }
}
void Core::unsubscribeToProperty(VehicleProperty::Property , AbstractSink* self)
SourceList mSources;
SinkList mSinks;
- std::unordered_map<VehicleProperty::Property, SinkList> propertySinkMap;
+ unordered_map<VehicleProperty::Property, SinkList> propertySinkMap;
};
#include "abstractsink.h"
+#include "abstractroutingengine.h"
AbstractSink::AbstractSink()
{
#include <boost/any.hpp>
#include "vehicleproperty.h"
-#include "abstractroutingengine.h"
using namespace std;
+class AbstractRoutingEngine;
class AbstractSink;
typedef list<AbstractSink*> SinkList;