~ci-train-bot/location-service/location-service-ubuntu-yakkety-1895

« back to all changes in this revision

Viewing changes to include/location_service/com/ubuntu/location/service/interface.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_INTERFACE_H_
 
2
#define LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_INTERFACE_H_
 
3
 
 
4
#include "com/ubuntu/location/service/session/interface.h"
 
5
 
 
6
#include <org/freedesktop/dbus/service.h>
 
7
#include <org/freedesktop/dbus/traits/service.h>
 
8
#include <org/freedesktop/dbus/types/object_path.h>
 
9
 
 
10
#include <chrono>
 
11
#include <functional>
 
12
 
 
13
namespace dbus = org::freedesktop::dbus;
 
14
 
 
15
namespace com
 
16
{
 
17
namespace ubuntu
 
18
{
 
19
namespace location
 
20
{
 
21
struct Criteria;
 
22
namespace service
 
23
{
 
24
class Interface
 
25
{
 
26
  protected:
 
27
    friend class ServiceStub;
 
28
    friend class ServiceSkeleton;
 
29
    friend class Service;
 
30
 
 
31
    struct Errors
 
32
    {
 
33
        struct InsufficientPermissions { inline static std::string name() { return "com.ubuntu.location.Service.Error.InsufficientPermissions"; } };
 
34
        struct CreatingSession { inline static std::string name() { return "com.ubuntu.location.Service.Error.CreatingSession"; } };
 
35
    };
 
36
 
 
37
    struct CreateSessionForCriteria
 
38
    {
 
39
        typedef com::ubuntu::location::service::Interface Interface;
 
40
 
 
41
        inline static const std::string& name()
 
42
        {
 
43
            static const std::string s
 
44
            {
 
45
                "CreateSessionForCriteria"
 
46
            };
 
47
            return s;
 
48
        }
 
49
 
 
50
        typedef dbus::types::ObjectPath ResultType;
 
51
 
 
52
        inline static const std::chrono::milliseconds default_timeout() { return std::chrono::seconds{1}; }
 
53
    };
 
54
 
 
55
    Interface() = default;
 
56
 
 
57
  public:
 
58
    typedef std::shared_ptr<Interface> Ptr;
 
59
 
 
60
    inline static const std::string& path()
 
61
    {
 
62
        static const std::string s{"/com/ubuntu/location/Service"};
 
63
        return s;
 
64
    }
 
65
 
 
66
    Interface(const Interface&) = delete;
 
67
    Interface& operator=(const Interface&) = delete;
 
68
    virtual ~Interface() = default;
 
69
 
 
70
    virtual session::Interface::Ptr create_session_for_criteria(const Criteria& criteria) = 0;
 
71
};
 
72
}
 
73
}
 
74
}
 
75
}
 
76
 
 
77
namespace org
 
78
{
 
79
namespace freedesktop
 
80
{
 
81
namespace dbus
 
82
{
 
83
namespace traits
 
84
{
 
85
template<>
 
86
struct Service<com::ubuntu::location::service::Interface>
 
87
{
 
88
    static const std::string& interface_name()
 
89
    {
 
90
        static const std::string s
 
91
        {
 
92
            "com.ubuntu.location.Service"
 
93
        };
 
94
        return s;
 
95
    }
 
96
};
 
97
}
 
98
}
 
99
}
 
100
}
 
101
 
 
102
#include "com/ubuntu/location/codec.h"
 
103
 
 
104
#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_INTERFACE_H_