softwarecontainer  0.18.0-739e8d7 2017-05-04
softwarecontainer::ContainerAbstractInterface Class Referenceabstract
Inheritance diagram for softwarecontainer::ContainerAbstractInterface:
[legend]
Collaboration diagram for softwarecontainer::ContainerAbstractInterface:
[legend]

Public Types

typedef std::function< int()> ExecFunction
 

Public Member Functions

virtual const char * id () const =0
 
virtual bool initialize ()=0
 
virtual bool create ()=0
 
virtual bool start (pid_t *pid)=0
 
virtual bool stop ()=0
 
virtual bool shutdown ()=0
 
virtual bool shutdown (unsigned int timeout)=0
 
virtual bool suspend ()=0
 
virtual bool resume ()=0
 
virtual bool destroy ()=0
 
virtual bool destroy (unsigned int timeout)=0
 
virtual bool mountDevice (const std::string &pathInHost)=0
 
virtual bool bindMountInContainer (const std::string &pathInHost, const std::string &pathInContainer, bool readOnly=true)=0
 Tries to bind mount a path from host to container. More...
 
virtual bool setEnvironmentVariable (const std::string &variable, const std::string &value)=0
 
virtual bool setCgroupItem (std::string subsys, std::string value)=0
 
virtual bool execute (ExecFunction function, pid_t *pid, const EnvironmentVariables &variables=EnvironmentVariables(), int stdin=-1, int stdout=-1, int stderr=2)=0
 Executes a commandline. More...
 
virtual bool execute (const std::string &commandLine, pid_t *pid, const EnvironmentVariables &variables=EnvironmentVariables(), const std::string &workingDirectory="/", int stdin=-1, int stdout=1, int stderr=2)=0
 Executes a function. More...
 

Detailed Description

Definition at line 28 of file containerabstractinterface.h.

Member Function Documentation

virtual bool softwarecontainer::ContainerAbstractInterface::bindMountInContainer ( const std::string &  pathInHost,
const std::string &  pathInContainer,
bool  readOnly = true 
)
pure virtual

Tries to bind mount a path from host to container.

Any missing parent paths will be created.

Parameters
pathInHostThe path on the host that shall be bind mounted into the container
pathInContainerWhere to mount the path in the container.
readonlySets if the mount should be read only or read write
Returns
true if everything worked as expected, false otherwise

Implemented in softwarecontainer::Container.

virtual bool softwarecontainer::Executable::execute ( ExecFunction  function,
pid_t *  pid,
const EnvironmentVariables &  variables = EnvironmentVariables(),
int  stdin = -1,
int  stdout = -1,
int  stderr = 2 
)
pure virtualinherited

Executes a commandline.

Implemented in softwarecontainer::Container.

virtual bool softwarecontainer::Executable::execute ( const std::string &  commandLine,
pid_t *  pid,
const EnvironmentVariables &  variables = EnvironmentVariables(),
const std::string &  workingDirectory = "/",
int  stdin = -1,
int  stdout = 1,
int  stderr = 2 
)
pure virtualinherited

Executes a function.

Implemented in softwarecontainer::Container.


The documentation for this class was generated from the following file: