Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
RdkPluginBase.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 2020 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 #ifndef RDKPLUGINBASE_H
20 #define RDKPLUGINBASE_H
21 
22 #include "IDobbyRdkPlugin.h"
23 
24 // -----------------------------------------------------------------------------
34 {
35 public:
36  virtual ~RdkPluginBase() {}
37 
38  // ***Inherited classes must implement these, no excuses***
39 public:
40  // virtual std::string name() const override;
41  // virtual unsigned hookHints() const override;
42 
43  // ***Inherited classes should override the following where appropriate***
44 public:
45  // See OCI Documentation here for more info on OCI hooks: https://github.com/opencontainers/runtime-spec/blob/master/config.md#posix-platform-hooks
46 
58  virtual bool postInstallation()
59  {
60  return true;
61  };
62 
73  virtual bool preCreation()
74  {
75  return true;
76  };
77 
93  virtual bool createRuntime()
94  {
95  return true;
96  };
97 
112  virtual bool createContainer()
113  {
114  return true;
115  };
116 
117 #ifdef USE_STARTCONTAINER_HOOK
132  virtual bool startContainer()
133  {
134  return true;
135  };
136 #endif
137 
151  virtual bool postStart()
152  {
153  return true;
154  };
155 
168  virtual bool postHalt()
169  {
170  return true;
171  };
172 
187  virtual bool postStop()
188  {
189  return true;
190  };
191 
192 public:
201  std::vector<std::string> getDependencies() const override
202  {
203  std::vector<std::string> noDependencies;
204  return noDependencies;
205  }
206 };
207 
208 #endif // !defined(RDKPLUGINBASE_H)
Interface that plugin libraries have to implement.
Definition: IDobbyRdkPlugin.h:49
Basic object that provides the default overrides for a plugin.
Definition: RdkPluginBase.h:34
virtual bool postStop()
Definition: RdkPluginBase.h:187
std::vector< std::string > getDependencies() const override
Should return the names of the plugins this plugin depends on.
Definition: RdkPluginBase.h:201
virtual bool postHalt()
Definition: RdkPluginBase.h:168
virtual bool preCreation()
Definition: RdkPluginBase.h:73
virtual bool createContainer()
Definition: RdkPluginBase.h:112
virtual bool createRuntime()
Definition: RdkPluginBase.h:93
virtual bool postStart()
Definition: RdkPluginBase.h:151
virtual bool postInstallation()
Definition: RdkPluginBase.h:58