1 //******************************************************************
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 #ifndef INTERNALUBAPI_H_
7 #define INTERNALUBAPI_H_
9 // ============================================================================
11 // ============================================================================
19 // ============================================================================
21 // ============================================================================
26 // ============================================================================
28 // ============================================================================
29 class OCDiscoverServicesResult {
30 // ============================================================
32 // ============================================================
34 virtual ~OCDiscoverServicesResult() {}
36 // ============================================================
38 // ============================================================
40 virtual OCQueryResultType getResult() const = 0;
41 virtual const std::list<std::string>& getServiceList() const = 0;
44 typedef std::function<void (const OCDiscoverServicesResult&)> OCDiscoverServicesFunction;
46 // ============================================================================
48 // ============================================================================
49 class OCModel : public std::enable_shared_from_this<OCModel> {
50 // ============================================================
52 // ============================================================
54 typedef std::shared_ptr<OCModel> SharedPtr;
55 typedef std::weak_ptr<OCModel> WeakPtr;
57 // ============================================================
59 // ============================================================
61 static SharedPtr createModel();
63 // ============================================================
65 // ============================================================
69 // ============================================================
71 // ============================================================
77 * IP Address of host device
81 * Host device is client, server, or client-server
84 * true - successfully started the OC Stack
85 * false - error starting the OC Stack
87 virtual bool start(const std::string ipAddr, int16_t port, OCStackMode mode) = 0;
90 * Get all services that have been discovered at time of call
92 * @param asyncReturnFunc - asynchronous callback function that is invoked
93 * by the OCModel when service discovery
94 * is complete. The callback will include
95 * status and a list of all discovered services
97 virtual void discoverServices(OCDiscoverServicesFunction& asyncReturnFunc) = 0;
100 * Add a service to the OCModel
106 * Total number of services in the OCModel
108 virtual uint16_t addService(const std::string url) = 0;
116 #endif /* INTERNALUBAPI_H_ */