client-cpp  0.7.4
Kaa.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef KAA_HPP_
18 #define KAA_HPP_
19 
20 #include <memory>
21 
22 #include <botan/botan.h>
23 
24 #include "kaa/IKaaClient.hpp"
28 
29 #ifdef __GNUC__
30 #define KAA_DEPRECATED __attribute__ ((deprecated))
31 #elif defined(_MSC_VER)
32 #define KAA_DEPRECATED __declspec(deprecated)
33 #else
34 #pragma message("WARNING: You need to implement KAA_DEPRECATED for this compiler")
35 #endif
36 
37 namespace kaa {
38 
44 class Kaa
45 {
46 public:
50  Kaa() = delete;
51 
55  Kaa(const Kaa&) = delete;
56 
60  Kaa& operator=(const Kaa&) = delete;
61 
70  static std::shared_ptr<IKaaClient> newClient(IKaaClientPlatformContextPtr context = std::make_shared<KaaClientPlatformContext>()
72 
78  KAA_DEPRECATED
79  static void init(int options = 0/* unused */);
80 
86  KAA_DEPRECATED
87  static void start();
88 
94  KAA_DEPRECATED
95  static void stop();
96 
102  KAA_DEPRECATED
103  static void pause();
104 
110  KAA_DEPRECATED
111  static void resume();
112 
120  KAA_DEPRECATED
121  static IKaaClient& getKaaClient();
122 
123 private:
124  static Botan::LibraryInitializer botanInit_;
125  static std::shared_ptr<IKaaClient> client_;
126 };
127 
128 }
129 
130 #endif
std::shared_ptr< IKaaClientPlatformContext > IKaaClientPlatformContextPtr
Kaa()=delete
Use newClient() to create a Kaa client instance.
Kaa & operator=(const Kaa &)=delete
Use newClient() to create a Kaa client instance.
static KAA_DEPRECATED IKaaClient & getKaaClient()
Retrieves the Kaa client.
static std::shared_ptr< IKaaClient > newClient(IKaaClientPlatformContextPtr context=std::make_shared< KaaClientPlatformContext >(), IKaaClientStateListenerPtr listener=IKaaClientStateListenerPtr())
Creates a new instance of a Kaa client.
static KAA_DEPRECATED void start()
Starts Kaa's workflow.
static KAA_DEPRECATED void resume()
Resumes Kaa's workflow.
static KAA_DEPRECATED void init(int options=0)
Initialize Kaa library.
Creates a new Kaa client based on IKaaClientPlatformContext and optional IKaaClientStateListener.
Definition: Kaa.hpp:44
static KAA_DEPRECATED void pause()
Pauses Kaa's workflow.
static KAA_DEPRECATED void stop()
Stops Kaa's workflow.
std::shared_ptr< IKaaClientStateListener > IKaaClientStateListenerPtr