DDS  ver. 3.6
worker.h
Go to the documentation of this file.
1 // Copyright 2014 GSI, Inc. All rights reserved.
2 //
3 //
4 //
5 #ifndef WORKER_H
6 #define WORKER_H
7 //=============================================================================
8 // std
9 #include <iosfwd>
10 // MiscCommon
11 #include "def.h"
12 // pod-ssh
13 #include "SSHConfigFile.h"
14 #include "local_types.h"
15 //=============================================================================
16 namespace dds
17 {
18  namespace ssh_cmd
19  {
20  enum ETaskType
21  {
26  };
27  //=============================================================================
28  class CWorker
29  {
30  public:
31  CWorker(dds::configRecord_t _rec, const SWNOptions& _options, const std::string& _path);
32  ~CWorker();
33 
34  void printInfo(std::ostream& _stream) const;
35  bool run(ETaskType _param);
36  std::string getID() const
37  {
38  return m_rec->m_id;
39  }
40 
41  private:
42  bool exec_command(const std::string& _cmd) const;
43  void log(const std::string& _msg) const;
44 
45  private:
46  dds::configRecord_t m_rec;
47  SWNOptions m_options;
48  std::string m_path;
49  };
50  } // namespace ssh_cmd
51 } // namespace dds
52 #endif
CWorker(dds::configRecord_t _rec, const SWNOptions &_options, const std::string &_path)
Definition: worker.cpp:23
std::shared_ptr< SConfigRecord > configRecord_t
Definition: SSHConfigFile.h:45
Definition: worker.h:22
Definition: worker.h:23
void printInfo(std::ostream &_stream) const
Definition: worker.cpp:42
Definition: worker.h:25
Miscellaneous functions and helpers are located here.
Definition: AgentConnectionManager.h:13
bool run(ETaskType _param)
Definition: worker.cpp:48
~CWorker()
Definition: worker.cpp:38
Definition: worker.h:28
Definition: worker.h:24
std::string getID() const
Definition: worker.h:36
Definition: local_types.h:15
ETaskType
Definition: worker.h:20