Merge "Merge branch 'master' into notification-service" into notification-service
[platform/upstream/iotivity.git] / resource / include / OCApi.h
index 21d56e7..1188db1 100644 (file)
@@ -18,8 +18,8 @@
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#ifndef __INTEL_OCAPI_H_2014_07_10
-#define __INTEL_OCAPI_H_2014_07_10
+#ifndef OC_OCAPI_H_
+#define OC_OCAPI_H_
 
 #include <string>
 #include <sstream>
@@ -27,6 +27,9 @@
 #include <map>
 #include <memory>
 #include <iterator>
+#if defined(_MSC_VER)
+#include <functional>
+#endif
 
 #include "octypes.h"
 #include "OCHeaderOption.h"
@@ -41,10 +44,14 @@ namespace OC
     class OCResource;
     class OCResourceRequest;
     class OCResourceResponse;
+    class OCDirectPairing;
 } // namespace OC
 
 namespace OC
 {
+#if defined(_MSC_VER)
+    extern std::ostream& oclog();
+#else
     typedef boost::iostreams::stream<OC::oc_log_stream>     log_target_t;
 
     namespace detail
@@ -65,7 +72,7 @@ namespace OC
     {
         return detail::oclog_target();
     };
-
+#endif
 } // namespace OC
 
 namespace OC
@@ -214,6 +221,9 @@ namespace OC
     // Typedef for query parameter map
     typedef std::map<std::string, std::string> QueryParamsMap;
 
+    // Typedef for query parameter map with Vector
+    typedef std::map< std::string, std::vector<std::string> > QueryParamsList;
+
     // Typedef for list of observation IDs
     typedef std::vector<OCObservationId> ObservationIds;
 
@@ -229,6 +239,10 @@ namespace OC
         ObserveAction action;
         // Identifier for observation being registered/unregistered
         OCObservationId obsId;
+
+        OCConnectivityType connectivityType;
+        std::string address;
+        uint16_t port;
     } ObservationInfo;
 
     // const strings for different interfaces
@@ -245,9 +259,13 @@ namespace OC
     // Used in GET, PUT, POST methods on links to other remote resources of a group.
     const std::string GROUP_INTERFACE = "oic.mi.grp";
 
+    //Typedef for list direct paired devices
+    typedef std::vector<std::shared_ptr<OCDirectPairing>> PairedDevices;
 
     typedef std::function<void(std::shared_ptr<OCResource>)> FindCallback;
 
+    typedef std::function<void(const std::string&, const int)> FindErrorCallback;
+
     typedef std::function<void(const OCRepresentation&)> FindDeviceCallback;
 
     typedef std::function<void(const OCRepresentation&)> FindPlatformCallback;
@@ -271,6 +289,15 @@ namespace OC
 
     typedef std::function<void(const HeaderOptions&,
                                 const OCRepresentation&, const int, const int)> ObserveCallback;
+
+    typedef std::function<void(std::shared_ptr<OCDirectPairing>, OCStackResult)> DirectPairingCallback;
+
+    typedef std::function<void(const PairedDevices&)> GetDirectPairedCallback;
+
+    typedef std::function<void(const HeaderOptions&,
+                               const OCRepresentation&, const int,
+                               std::shared_ptr<OCResource>)> MQCreateTopicCallback;
+
 } // namespace OC
 
 #endif