9 #ifndef SDK_NAVBOX_SIMULATION_ROUTE_IMPL_H_
10 #define SDK_NAVBOX_SIMULATION_ROUTE_IMPL_H_
15 #include <base/inc/exception.h>
17 #include <base/inc/sdk_component_base.h>
19 #include <base/inc/interfaces/properties/properties_impl.h>
22 SDK_NAVBOX_CLIENT_BEGIN_NAMESPACE
39 if (
SDK_FAILED(GetPropertyT(kSimulationWaypointProperty_Lat, pos.lat)) ||
40 SDK_FAILED(GetPropertyT(kSimulationWaypointProperty_Lon, pos.lon))) {
50 SDKAny& value)
const throw() {
53 std::map<SDKUInt32, ScopedAny >::const_iterator it =
54 m_properties.find(
id);
55 if (it == m_properties.end())
57 value = ScopedAny(it->second).
Detach();
63 m_properties[id] = value;
67 std::map<SDKUInt32, ScopedAny> m_properties;
70 class SimulationRoute :
public SDKComponentBaseI<ISimulationRoute> {
76 virtual SDKResult SDK_CALLTYPE GetWaypointsCount(
77 SDKUInt32& count)
const throw() {
80 count = m_waypoints.size();
86 virtual SDKResult SDK_CALLTYPE GetWaypoint(
88 ISimulationWaypointSP& waypoint)
const throw() {
91 if (index >= m_waypoints.size())
93 waypoint = m_waypoints[index];
99 virtual SDKResult SDK_CALLTYPE GetDepartureTime(
103 ISimulationWaypointSP waypoint;
110 void PushWaypoint(
const ISimulationWaypointSP waypoint) {
112 m_waypoints.push_back(waypoint);
116 std::vector<ISimulationWaypointSP> m_waypoints;
119 class SimulationShipModelParams :
120 public PropertiesMap<ISimulationShipModelParams>
123 SimulationShipModelParams() {}
124 ~SimulationShipModelParams() {}
127 virtual SDKResult SDK_CALLTYPE GetDeadweight(
128 double& deadweight)
const throw() {
129 return GetProperty(kWNISimulationShipProperty_Deadweight,
130 SDKAnyReturnHelper<double>(deadweight));
134 virtual SDKResult SDK_CALLTYPE SetDeadweight(
135 double deadweight)
throw() {
136 return SetPropertyT(kWNISimulationShipProperty_Deadweight,
141 virtual SDKResult SDK_CALLTYPE GetSummerDraft(
142 double& summer_draft)
const throw() {
143 return GetProperty(kWNISimulationShipProperty_SummerDraft,
144 SDKAnyReturnHelper<double>(summer_draft));
148 virtual SDKResult SDK_CALLTYPE SetSummerDraft(
149 double summer_draft)
throw() {
150 return SetPropertyT(kWNISimulationShipProperty_SummerDraft,
155 SDK_NAVBOX_CLIENT_END_NAMESPACE
157 #endif // SDK_NAVBOX_SIMULATION_ROUTE_IMPL_H_