~thomas-voss/location-service/fix-service-path

« back to all changes in this revision

Viewing changes to src/location_service/com/ubuntu/location/engine.h

Expose service::State to the bus. (LP: #1536774)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <com/ubuntu/location/provider_selection_policy.h>
25
25
#include <com/ubuntu/location/satellite_based_positioning_state.h>
26
26
#include <com/ubuntu/location/space_vehicle.h>
 
27
#include <com/ubuntu/location/state_tracking_provider.h>
27
28
#include <com/ubuntu/location/wifi_and_cell_reporting_state.h>
28
29
 
29
30
#include <com/ubuntu/location/settings.h>
151
152
    virtual ProviderSelection determine_provider_selection_for_criteria(const Criteria& criteria);
152
153
 
153
154
    /**
154
 
     * @brief Checks if the engine knows about a specific provider.
155
 
     * @return True iff the engine knows about the provider.
156
 
     */
157
 
    virtual bool has_provider(const Provider::Ptr& provider) noexcept;
158
 
 
159
 
    /**
160
155
     * @brief Makes a provider known to the engine.
161
156
     * @param provider The new provider.
162
157
     */
163
158
    virtual void add_provider(const Provider::Ptr& provider);
164
159
 
165
160
    /**
166
 
     * @brief Removes a provider from the engine.
167
 
     * @param provider The provider to be removed.
168
 
     */
169
 
    virtual void remove_provider(const Provider::Ptr& provider) noexcept;
170
 
 
171
 
    /**
172
161
     * @brief Iterates all known providers and invokes the provided enumerator for each of them.
173
162
     * @param enumerator The functor to be invoked for each provider.
174
163
     */
189
178
        core::ScopedConnection wifi_and_cell_id_reporting_state_updates;
190
179
        core::ScopedConnection space_vehicle_visibility_updates;
191
180
        core::ScopedConnection provider_position_updates;
 
181
        core::ScopedConnection provider_state_updates;
192
182
    };
193
183
 
194
 
    mutable std::mutex guard;
195
 
    std::map<Provider::Ptr, ProviderConnections> providers;
 
184
    mutable std::recursive_mutex guard;
 
185
    std::map<StateTrackingProvider::Ptr, ProviderConnections> providers;
196
186
    ProviderSelectionPolicy::Ptr provider_selection_policy;
197
187
    Settings::Ptr settings;
198
188
    UpdatePolicy::Ptr update_policy;