cleaned up headers
authorKevron Rees <kevron_m_rees@linux.intel.com>
Tue, 14 Aug 2012 23:52:28 +0000 (16:52 -0700)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Tue, 14 Aug 2012 23:52:28 +0000 (16:52 -0700)
ambd/core.cpp
ambd/core.h
lib/abstractsink.cpp
lib/abstractsink.h

index 47f9b79..223aaf8 100644 (file)
@@ -91,7 +91,12 @@ void Core::setProperty(VehicleProperty::Property , boost::any )
 
 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)
index f464ef6..0ee4cea 100644 (file)
@@ -50,7 +50,7 @@ private:
        SourceList mSources;
        SinkList mSinks;
        
-       std::unordered_map<VehicleProperty::Property, SinkList> propertySinkMap;
+       unordered_map<VehicleProperty::Property, SinkList> propertySinkMap;
     
 };
 
index 2629e35..b77e096 100644 (file)
@@ -18,6 +18,7 @@
 
 
 #include "abstractsink.h"
+#include "abstractroutingengine.h"
 
 AbstractSink::AbstractSink()
 {
index cabb7b1..3ce54d7 100644 (file)
 #include <boost/any.hpp>
 
 #include "vehicleproperty.h"
-#include "abstractroutingengine.h"
 
 using namespace std;
 
+class AbstractRoutingEngine;
 class AbstractSink;
 
 typedef list<AbstractSink*> SinkList;