2 * Copyright (C) 2012 TOYOTA MOTOR CORPORATION.
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.
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.
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
19 #ifndef AMBINTERFACE_H
20 #define AMBINTERFACE_H
28 #include "abstractsource.h"
29 #include "ambconfig.h"
32 * Vehicle information of AMB.
34 struct AMBVehicleInfo {
36 AbstractPropertyType *value;
41 class VICCommunicator;
44 * Interface of AMB-Core and Plugin.
46 class AMBIF : public AbstractSource {
51 * @param engine Instance of AMB-Core.
52 * @param config Information in a configuration file of AMB.
54 AMBIF(AbstractRoutingEngine *engine,
55 std::map<std::string, std::string> config);
62 * AMBIF class receives a request for acquisition of information from AMB-Core.
63 * Vehicle Information stored in the hold, plugin will return the data.
65 * @param reply Variable for storing the vehiclle information to be returnd to AMB-Core.
68 getPropertyAsync(AsyncPropertyReply *reply);
70 * AMBIF class receives a request for a change in the vehicle information from AMB-Core.
71 * Changes to vehicle information received from its own information.
73 * @param request Vehicle information that has been requested change.
74 * @return Vehicle information after the change.
77 setProperty(AsyncSetPropertyRequest request);
79 * AMBIF class receives a request for acquisition of vehicle information list from AMB-Core.
81 * @return Vehicle information list held by the plugin.
86 * AMBIF class receives from AMB-Core a request for obtaining the operation list.
87 * AMBIF class supports the operations(Get/Set)
92 supportedOperations();
95 * AMBIF class will issue a UUID.
102 * AMBIF class is received the vehicle information that other plugin updated.
104 * @param property the name of Vehicle information of AMB.
105 * @param value the value of Vehicle information of AMB.
106 * @param uuid UUID of the source plugin.
109 propertyChanged(VehicleProperty::Property property,
110 AbstractPropertyType *value, std::string uuid);
112 * AMBIF class reads the configuration file AMB.
114 * @param config Information in a configuration file of AMB.
117 setConfiguratin(std::map<std::string, std::string> config);
122 * @param comm Instance of VICCommunicator.
123 * @param conf Instance of Config.
124 * @return Success : true Failure : false
127 initialize(VICCommunicator *comm, AMBConfig *conf);
129 * AMBIF class is required to get the vehicle information to AMB-Core.
131 * @param propertyname The name of vehicle information of AMB.
132 * @return The value of vehicle information of AMB.
135 getPropertyRequest(std::string propertyname);
137 * AMBIF class ask AMB-Core to change the vehicle information.
138 * This request is used for vehicle information that is managed by other plugin.
140 * @param vehicleinfo Vehicle information of AMB.(name and value)
143 setPropertyRequest(AMBVehicleInfo *vehicleinfo);
145 * AMBIF class notify a change in the vehicle information to the AMB-Core.
146 * This instruction is subject to only the vehicle information that is managed by the plugin.
148 * @param vehicleinfo Vehicle information of AMB.(name and value)
151 updateProperty(AMBVehicleInfo *vehicleinfo);
153 * AMBIF class locks the vehicle information changes.
158 * AMBIF class releases the lock status of the vehicle information changes.
163 * This function is an interface with other objects in the Plugin.
164 * This interface issues a request to change the information.
166 * @param vehicleinfo Vehicle information of AMB.
169 requestUpdate(AMBVehicleInfo *vehicleinfo);
172 * Unused virtual function.
175 getRangePropertyAsync(AsyncRangePropertyReply *reply)
179 * Unused virtual function.
182 subscribeToPropertyChanges(VehicleProperty::Property property)
186 * Unused virtual function.
189 unsubscribeToPropertyChanges(VehicleProperty::Property property)
193 * Unused virtual function.
196 supportedChanged(PropertyList)
201 registVehicleInfo(std::string propertyName, DataType type,
204 find(std::string propertyName);
206 PropertyList propertylist;
207 vector<AMBVehicleInfo> vehicleinfoArray;
208 VICCommunicator *communicator;
209 pthread_mutex_t mutex;
211 #endif // #ifndef AMBINTERFACE_H