-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommit_container_cmd.hh
More file actions
48 lines (36 loc) · 1.28 KB
/
commit_container_cmd.hh
File metadata and controls
48 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef COMMIT_CONTAINER_CMD_HPP
#define COMMIT_CONTAINER_CMD_HPP
#include <memory>
#include <nlohmann/json.hpp>
#include "abstr_sync_docker_cmd_exec.hh"
#include "synch_docker_cmd.hh"
namespace dockercpp::command {
class CommitContainerCmd : public SynchDockerCmd<std::string>,
public std::enable_shared_from_this<CommitContainerCmd> {
public:
virtual std::string getContainerId() = 0;
virtual std::string getRepository() = 0;
};
namespace commitcontainer {
class Exec : public exec::DockerCmdSyncExec<CommitContainerCmd, std::string> {
public:
~Exec() {}
};
} // namespace commitcontainer
class CommitContainerCmdImpl : public CommitContainerCmd,
public AbstrDockerCmd<CommitContainerCmd, std::string> {
public:
explicit CommitContainerCmdImpl(std::unique_ptr<commitcontainer::Exec> exec,
const std::string& containerId,
const std::string& repository);
std::string exec() override;
void close() override {}
std::string getContainerId() override;
std::string getRepository() override;
~CommitContainerCmdImpl() {}
private:
std::string m_containerId;
std::string m_repository;
};
} // namespace dockercpp::command
#endif /* COMMIT_CONTAINER_CMD_HPP */