Initial merge-commit of the OIC code. Should successfully do discovery for single...
[platform/upstream/iotivity.git] / csdk / controller / core / test / MockProtocol.h
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
5
6 #ifndef MOCKPROTOCOL_H_
7 #define MOCKPROTOCOL_H_
8
9 // ============================================================================
10 // Includes
11 // ============================================================================
12 #include <memory>
13 #include <string>
14 #include <functional>
15 #include "Protocol.hpp"
16 #include "Core.h"
17
18 // ============================================================================
19 // Namespace
20 // ============================================================================
21 namespace Intel {
22 namespace CCFL {
23 namespace Protocols {
24
25 // ============================================================================
26 // Class
27 // ============================================================================
28 class MockProtocol : public Protocol
29 {
30 public:
31         MockProtocol();
32         virtual ~MockProtocol();
33 public:
34         virtual void setModel(const std::shared_ptr<Intel::CCFL::API::Model>& model);
35         virtual const Handle getHandle();
36         virtual void setHandle(const Handle handle);
37         virtual const std::string& getName();
38         virtual void setName(const std::string& name);
39         virtual void forceDeviceDiscovery();
40
41 private:
42         std::string name_;
43         Handle handle_;
44         std::weak_ptr<API::Model> model_;
45
46 // Test interface
47 public:
48         void testAddDevice(const UUID_t& deviceId, const std::string deviceName);
49         void testRemoveDevice(const UUID_t& deviceId);
50 private:
51         static const std::string MOCK_DEVICE_ID;
52
53 };
54
55
56 }
57 }
58 }
59
60 #endif /* MOCKPROTOCOL_H_ */