hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Command.hpp
Go to the documentation of this file.
1 
14 #ifndef COMMAND_HPP
15 #define COMMAND_HPP
16 
17 #include <sstream>
18 #include <vector>
19 
20 namespace HCE
21 {
22 //-----------------------------------------------------------------------------
23 class Command
24 {
25 public:
26  typedef std::vector<std::pair<std::string, std::string> > Env;
27 
28  explicit Command(const std::string& commandLine, const std::string& shellName="");
29  Command(const std::string& commandLine, const std::string& initialDirectory, const std::string& inputStream_, const std::string& shellName="");
30  Command(const std::string& commandLine, const std::string& inputStream_, const Command::Env& env, const std::string& shellName="");
31  Command(const std::string& commandLine, const std::string& initialDirectory, const std::string& inputStream_, const Command::Env& env, const std::string& shellName="");
32  ~Command(void) {}
33 
34  void setShellName(const std::string& shellName_) {shellName=shellName_;}
35  std::string getShellName(void) const {return shellName;}
36 
37  void setCommandLine(const std::string& commandLine_) {commandLine=commandLine_;}
38  std::string getCommandLine(void) const {return commandLine;}
39 
40  void setInitialDirectory(const std::string& initialDirectory_) {initialDirectory=initialDirectory_;}
41  std::string getInitialDirectory(void) const {return initialDirectory;}
42 
43  void setInputStream(const std::string& inputStream_) {inputStream=inputStream_;}
44  std::string getInputStream(void) const {return inputStream;}
45 
46  void setEnvironments(const Command::Env& env_) {env=env_;}
47  const Command::Env& getEnvironments(void) const {return env;}
48 
49 private:
50  std::string shellName;
51  std::string commandLine;
52  std::string initialDirectory;
53  std::string inputStream;
54  Env env;
55 };
56 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
58 } // end namespace HCE
59 
60 #endif // COMMAND_HPP