Merge pull request #19 from tripzero/master
[profile/ivi/automotive-message-broker.git] / lib / propertyinfo.hpp
1 #ifndef PROPERTYINFO_H_
2 #define PROPERTYINFO_H_
3
4 #include "abstractpropertytype.h"
5 #include <list>
6
7 class PropertyInfo
8 {
9 public:
10
11
12         /** PropertyInfo
13          *
14          **/
15         PropertyInfo(): mUpdateFrequency(0), mIsValid(false) {}
16
17         /** PropertyInfo
18          * @arg updateFrequency
19          * @arg zonesList
20          */
21         PropertyInfo(uint updateFreq, std::list<Zone::Type> zonesList)
22                 :mUpdateFrequency(updateFreq), mZones(zonesList), mIsValid(true)
23         {
24
25         }
26
27
28         /** updateFrequency
29          * Maximum times per second a property is expected to update.
30          *
31          **/
32         uint updateFrequency()
33         {
34                 return mUpdateFrequency;
35         }
36
37         /** zones
38          * Number of different zones supported by this property.
39          *
40          */
41         std::list<Zone::Type> zones()
42         {
43                 return mZones;
44         }
45
46         /** isValid
47          * returns whether this PropertyInfo is valid
48          *
49          * default when you construct a PropertyInfo is false
50          **/
51         bool isValid()
52         {
53                 return mIsValid;
54         }
55
56
57         /** invalid()
58          * returns instance of PropertyInfo that isn't valid
59          **/
60         static PropertyInfo invalid()
61         {
62                 return PropertyInfo();
63         }
64
65 private:
66
67         uint mUpdateFrequency;
68         std::list<Zone::Type> mZones;
69         bool mIsValid;
70 };
71
72
73 #endif