Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Loading...
Searching...
No Matches
DobbyFactory.h
1/*
2* If not stated otherwise in this file or this component's LICENSE file the
3* following copyright and licenses apply:
4*
5* Copyright 2016 Sky UK
6*
7* Licensed under the Apache License, Version 2.0 (the "License");
8* you may not use this file except in compliance with the License.
9* You may obtain a copy of the License at
10*
11* http://www.apache.org/licenses/LICENSE-2.0
12*
13* Unless required by applicable law or agreed to in writing, software
14* distributed under the License is distributed on an "AS IS" BASIS,
15* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16* See the License for the specific language governing permissions and
17* limitations under the License.
18*/
19/*
20 * DobbyFactory.h
21 * Author:
22 *
23 */
24#ifndef DOBBYFACTORY_H
25#define DOBBYFACTORY_H
26
27#include <mutex>
28#include <memory>
29#include <string>
30#include <future>
31
32namespace AI_IPC
33{
34 class IIpcService;
35}
36
37class IDobbyProxy;
38
39
40// -----------------------------------------------------------------------------
52{
53public:
54 explicit DobbyFactory(const std::shared_ptr<AI_IPC::IIpcService> &ipcService);
56
57public:
58 void setWorkspacePath(const std::string& path);
59 void setFlashMountPath(const std::string& path);
60 void setPlatformIdent(const std::string& platformIdent);
61 void setPlatformType(const std::string& platformType);
62 void setPlatformModel(const std::string& platformModel);
63
64public:
65 std::shared_ptr<IDobbyProxy> getProxy();
66
67private:
68 bool startDobbyDaemon();
69 bool pingDobbyDaemon();
70
71private:
72 std::mutex mLock;
73 std::string mWorkspacePath;
74 std::string mFlashMountPath;
75 std::string mPlatformIdent;
76 std::string mPlatformType;
77 std::string mPlatformModel;
78
79private:
80 std::shared_ptr<AI_IPC::IIpcService> mIpcService;
81 std::shared_ptr<IDobbyProxy> mProxy;
82};
83
84#endif // !defined(DOBBYFACTORY_H)
85
Factory that spawns the DobbyDaemon and supplies a proxy to it.
Definition DobbyFactory.h:52
bool startDobbyDaemon()
Starts the Dobby 'Hypervisor' daemon.
Definition DobbyFactory.cpp:140
std::shared_ptr< IDobbyProxy > getProxy()
Starts the Dobby 'Hypervisor' daemon and returns a proxy object.
Definition DobbyFactory.cpp:248
bool pingDobbyDaemon()
Sends pings to the Dobby 'Hypervisor' daemon until a pong is received or we timeout.
Definition DobbyFactory.cpp:101
Wrapper around an IpcService object that provides simpler method calls to the Dobby 'hypervisor' daem...
Definition IDobbyProxy.h:92