Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
start.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License version 2.1 as published by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  */
17 
24 #ifndef LXCPP_COMMANDS_START_HPP
25 #define LXCPP_COMMANDS_START_HPP
26 
29 #include "lxcpp/guard/api.hpp"
30 
31 #include "utils/channel.hpp"
32 #include "cargo-ipc/client.hpp"
33 
34 #include <sys/types.h>
35 #include <memory>
36 
37 
38 namespace lxcpp {
39 
48 class Start final: public Command {
49 public:
50 
54  Start(std::shared_ptr<ContainerConfig>& config);
55  ~Start();
56 
57  void execute();
58 
59 private:
60  std::shared_ptr<ContainerConfig> mConfig;
61  std::string mGuardPath;
62 
63  void parent(const pid_t pid);
64  void daemonize();
65 };
66 
67 
68 } // namespace lxcpp
69 
70 
71 #endif // LXCPP_COMMANDS_START_HPP
std::shared_ptr< ContainerConfig > mConfig
Definition: start.hpp:60
void daemonize()
Definition: start.cpp:78
void parent(const pid_t pid)
Definition: start.cpp:67
IPC implementation for related processes.
Starts the container.
Definition: start.hpp:48
~Start()
Definition: start.cpp:49
std::string mGuardPath
Definition: start.hpp:61
IPC messages declaration.
Start(std::shared_ptr< ContainerConfig > &config)
Definition: start.cpp:43
void execute()
Definition: start.cpp:53
Command interface definition.
Definition: command.hpp:29
A definition of a ContainerConfig struct.