automotive-message-broker  0.14.803
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
abstractsource.h
1 /*
2  Copyright (C) 2012 Intel Corporation
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 
20 #ifndef ABSTRACTSOURCE_H
21 #define ABSTRACTSOURCE_H
22 
23 #include <string>
24 #include <list>
25 #include <boost/any.hpp>
26 
27 #include "abstractsink.h"
28 #include "vehicleproperty.h"
29 #include "abstractroutingengine.h"
30 #include "abstractpropertytype.h"
31 #include "propertyinfo.hpp"
32 
33 
34 
35 class AbstractSource;
36 
37 typedef std::list<AbstractSource*> SourceList;
38 
39 
40 
42 {
43 
44 public:
48  enum Operations {
49  Get = 0x01,
50  Set = 0x02,
51  GetRanged = 0x04
52  };
53 
54  AbstractSource(AbstractRoutingEngine* engine, map<string, string> config);
55  virtual ~AbstractSource();
56 
58 
64  virtual void getPropertyAsync(AsyncPropertyReply *reply) = 0;
65 
72  virtual void getRangePropertyAsync(AsyncRangePropertyReply *reply) = 0;
73 
81 
88  virtual void subscribeToPropertyChanges(VehicleProperty::Property property) = 0;
89 
95  virtual void unsubscribeToPropertyChanges(VehicleProperty::Property property) = 0;
96 
101  virtual int supportedOperations() = 0;
102 
109  virtual PropertyInfo getPropertyInfo(const VehicleProperty::Property & property) = 0;
110 
115  virtual PropertyList supported() = 0;
116 
117 protected:
123 
124 private:
125  AbstractSource():AbstractSink(nullptr, std::map<std::string,std::string>()) { }
126 };
127 
128 #endif // ABSTRACTSOURCE_H