#include "core.h"
#include <functional>
+#include <glib.h>
#include "listplusplus.h"
#include "debugout.h"
using namespace std::placeholders;
+int lastpps=0;
+
+static int PPSUpdate(void* data)
+{
+ int* pps = (int*)data;
+
+ int temp = *pps;
+
+ if(temp > 0 && temp != lastpps)
+ {
+ lastpps = temp;
+ DebugOut(1)<<"Property updates per second: "<<temp<<endl;
+ }
+
+ *pps = 0;
+}
+
Core::Core()
+ :propertiesPerSecond(0)
{
-
+ g_timeout_add(1000,PPSUpdate,&propertiesPerSecond);
}
Core::~Core()
SinkList list = propertySinkMap[property];
DebugOut()<<__FUNCTION__<<"() there are "<<list.size()<<" sinks connected to property: "<<property<<endl;
-
+
+ propertiesPerSecond++;
+
for(SinkList::iterator itr = list.begin(); itr != list.end(); itr++)
{
(*itr)->propertyChanged(property, value,(*itr)->uuid());
void Core::subscribeToProperty(VehicleProperty::Property property, AbstractSink* self)
{
- printf("Subscribing\n");
+ printf("Subscribing\n");
if(!ListPlusPlus<VehicleProperty::Property>(&mMasterPropertyList).contains((property)))
{
DebugOut()<<__FUNCTION__<<"(): property not supported: "<<property<<endl;
#include <listplusplus.h>
#include "debugout.h"
#include "bluetooth.hpp"
-#include "asyncqueuewatcher.h"
+
#define __SMALLFILE__ std::string(__FILE__).substr(std::string(__FILE__).rfind("/")+1)
AbstractRoutingEngine *m_re;