Initial merge-commit of the OIC code. Should successfully do discovery for single...
[platform/upstream/iotivity.git] / include / OCObserver.h
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
5
6 /// @file OCObserver.h 
7
8 /// @brief      This file contains the declaration of classes and its members related to 
9 ///                     OCObserver.
10
11 #ifndef __OCOBSERVER_H
12 #define __OCOBSERVER_H
13
14 #include <string>
15
16 #include "OCObserver.h"
17
18 namespace OC 
19 {
20         /* It allows an app to register a method handler to monitor for 
21         state changes on a resource. Not all resource attributes are observable. 
22         */
23         class OCObserver
24         {
25         public:
26                 OCObserver(void);
27
28                 virtual ~OCObserver(void);
29         };
30
31         /* It is likely that these signatures will change somewhat: */
32         template <typename HandlerT, typename ResourceT>
33         void bind_observer(HandlerT handler, ResourceT& resource, const std::string& name)
34         {};
35
36         // unbind the specified handler:
37         template <typename HandlerT, typename ResourceT>
38         void unbind_observer(HandlerT handler, ResourceT& resource)
39         {};
40
41         // unbind by name:
42         template <typename HandlerT, typename ResourceT>
43         void unbind_observer(HandlerT handler, ResourceT& resource, const std::string& name)
44         {};
45
46 } // namespace OC
47
48 #endif //__OCOBSERVER_H