compiles now
authorKevron Rees <kevron_m_rees@linux.intel.com>
Fri, 28 Jun 2013 21:29:52 +0000 (14:29 -0700)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Fri, 28 Jun 2013 21:29:52 +0000 (14:29 -0700)
ambd/core.cpp
lib/abstractsource.cpp
lib/propertyinfo.hpp
plugins/database/databasesink.cpp
plugins/exampleplugin.h

index 019196a..f8e2d81 100644 (file)
@@ -347,7 +347,7 @@ PropertyInfo Core::getPropertyInfo(VehicleProperty::Property property, string so
                }
        }
 
-       return PropertyInfo();
+       return PropertyInfo::invalid();
 }
 
 std::list<string> Core::getSourcesForProperty(VehicleProperty::Property property)
index f0dab01..c60c7e6 100644 (file)
@@ -32,7 +32,7 @@ AbstractSource::~AbstractSource()
 
 PropertyInfo AbstractSource::getPropertyInfo(VehicleProperty::Property property)
 {
-       return PropertyInfo();
+       return PropertyInfo::invalid();
 }
 
 
index 8c2ec4f..329ebbd 100644 (file)
@@ -7,10 +7,16 @@
 class PropertyInfo
 {
 public:
+
        /** PropertyInfo
-        *
-        **/
-       PropertyInfo(): mUpdateFrequency(0) {}
+        * @arg updateFrequency
+        * @arg zonesList
+        */
+       PropertyInfo(uint updateFreq, std::list<Zone::Type> zonesList)
+               :mUpdateFrequency(updateFreq), mZones(zonesList), mIsValid(true)
+       {
+
+       }
 
 
        /** updateFrequency
@@ -31,10 +37,36 @@ public:
                return mZones;
        }
 
+       /** isValid
+        * returns whether this PropertyInfo is valid
+        *
+        * default when you construct a PropertyInfo is false
+        **/
+       bool isValid()
+       {
+               return mIsValid;
+       }
+
+
+       /** invalid()
+        * returns instance of PropertyInfo that isn't valid
+        **/
+       static PropertyInfo invalid()
+       {
+               return PropertyInfo();
+       }
+
+protected:
+       /** PropertyInfo
+        *
+        **/
+       PropertyInfo(): mUpdateFrequency(0), mIsValid(false) {}
+
 private:
 
        uint mUpdateFrequency;
        std::list<Zone::Type> mZones;
+       bool mIsValid;
 };
 
 
index 423e043..718d2cc 100644 (file)
@@ -204,7 +204,7 @@ PropertyList DatabaseSink::supported()
 PropertyInfo DatabaseSink::getPropertyInfo(VehicleProperty::Property property)
 {
        /// TODO: Compute update frequency for properties in the database
-       return PropertyInfo();
+       return PropertyInfo::invalid();
 }
 
 void DatabaseSink::parseConfig()
index 8412de1..15e0acb 100644 (file)
@@ -45,7 +45,10 @@ public:
        
        void randomizeProperties();
 
-       PropertyInfo getPropertyInfo(VehicleProperty::Property ) { return PropertyInfo(); }
+       PropertyInfo getPropertyInfo(VehicleProperty::Property ) {
+               /// TODO FIXME don't just return an invalid property info
+               return PropertyInfo::invalid();
+       }
        
 private:
        PropertyList mRequests;