Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Loading...
Searching...
No Matches
BaseService.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 2018 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 * File: BaseService.h
21 *
22 */
23#ifndef BASESERVICE_H
24#define BASESERVICE_H
25
26#include <IIpcService.h>
27#include <list>
28#include <string>
29#include <functional>
30
31namespace AI_IPC
32{
33
39{
40public:
41 BaseService(const std::shared_ptr<AI_IPC::IIpcService>& ipcService,
42 const std::string &serviceName,
43 const std::string &serviceObject);
44 virtual ~BaseService();
45protected:
47 {
48 ServiceMethod(const char *iface, const char* name, std::function<void(std::shared_ptr<AI_IPC::IAsyncReplySender>)> func) :
49 mIface(iface), mName(name), mFunc(func) {}
50 const char *mIface;
51 const char *mName;
52 std::function<void(std::shared_ptr<AI_IPC::IAsyncReplySender>)> mFunc;
53 };
54
55 void registerServiceMethods(const std::vector<ServiceMethod>& methods);
56private:
57 const std::shared_ptr<AI_IPC::IIpcService> mIpcService;
58 const std::string mServiceName;
59 const std::string mServiceObject;
60 std::list<std::string> mMethodHandlers;
61};
62
63} // namespace AI_IPC
64
65#endif // BASESERVICE_H
The BaseService class this is a base class for DBUS services. It has some helper functions to make it...
Definition BaseService.h:39
Definition BaseService.h:47