~sil2100/location-service/gps-arm64

« back to all changes in this revision

Viewing changes to include/location_service/com/ubuntu/location/service/skeleton.h

  • Committer: Thomas Voß
  • Date: 2013-05-28 14:20:45 UTC
  • Revision ID: thomas.voss@canonical.com-20130528142045-kq5umqdmm4o53vwk
Initial push.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SKELETON_H_
 
2
#define LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SKELETON_H_
 
3
 
 
4
#include "com/ubuntu/location/service/interface.h"
 
5
#include "com/ubuntu/location/service/permission_manager.h"
 
6
#include "com/ubuntu/location/service/session/interface.h"
 
7
 
 
8
#include <org/freedesktop/dbus/dbus.h>
 
9
#include <org/freedesktop/dbus/skeleton.h>
 
10
#include <org/freedesktop/dbus/types/object_path.h>
 
11
 
 
12
namespace com
 
13
{
 
14
namespace ubuntu
 
15
{
 
16
namespace location
 
17
{
 
18
namespace service
 
19
{
 
20
class Skeleton : public org::freedesktop::dbus::Skeleton<com::ubuntu::location::service::Interface>,
 
21
                 public std::enable_shared_from_this<Skeleton>
 
22
{
 
23
  public:
 
24
    typedef std::shared_ptr<Skeleton> Ptr;
 
25
    
 
26
    Skeleton(const dbus::Bus::Ptr& connection, const PermissionManager::Ptr& permission_manager);
 
27
    ~Skeleton() noexcept;
 
28
 
 
29
  private:
 
30
    struct SessionWrapper;
 
31
 
 
32
    void handle_create_session_for_criteria(DBusMessage* msg);
 
33
    void remove_session(const std::shared_ptr<SessionWrapper>& session);
 
34
    
 
35
    PermissionManager::Ptr permission_manager;
 
36
    dbus::DBus daemon;
 
37
    dbus::Object::Ptr object;
 
38
    std::mutex guard;
 
39
    std::map<dbus::types::ObjectPath, std::shared_ptr<SessionWrapper>> session_store;
 
40
};
 
41
}
 
42
}
 
43
}
 
44
}
 
45
#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SKELETON_H_