Initial merge-commit of the OIC code. Should successfully do discovery for single...
[platform/upstream/iotivity.git] / csdk / controller / core / include / core / Description.hpp
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
5
6 #ifndef DESCRIPTION_H_
7 #define DESCRIPTION_H_
8
9 // ============================================================================
10 // Includes
11 // ============================================================================
12 #include <string>
13 #include <memory>
14 #include <functional>
15 #include "Service.hpp"
16
17 // ============================================================================
18 // Namespace
19 // ============================================================================
20 namespace Intel {
21 namespace CCFL {
22 namespace API {
23
24 // ============================================================================
25 // Class
26 // ============================================================================
27 class DescriptionGetResult {
28         // ============================================================
29         // Destructor
30         // ============================================================
31         public:
32                 virtual ~DescriptionGetResult() {}
33
34         // ============================================================
35         // Public Method(s)
36         // ============================================================
37         public:
38                 virtual QueryResultType getResult() const = 0;
39                 virtual const std::set<Service::SharedPtr>& getServices() const = 0;
40 };
41
42 typedef std::function<void (const DescriptionGetResult&)> DescriptionGetFunction;
43
44 // ============================================================================
45 // Class
46 // ============================================================================
47 class Description {
48         // ============================================================
49         // Type Definition(s)
50         // ============================================================
51         public:
52                 typedef std::shared_ptr<Description> SharedPtr;
53                 typedef std::weak_ptr<Description> WeakPtr;
54
55         // ============================================================
56         // Destructor
57         // ============================================================
58         public:
59                 virtual ~Description() {}
60
61         // ============================================================
62         // Public Method(s)
63         // ============================================================
64         public:
65                 virtual const std::set<Service::SharedPtr>& getServices() const = 0;
66 };
67
68 }
69 }
70 }
71
72 #endif /* DESCRIPTION_H_ */