UMPS
The University of Utah Seismograph Stations Message Passing System.
replierProcess.hpp
1 #ifndef UMPS_PROXY_SERVICES_COMMAND_REPLIER_PROCESS_HPP
2 #define UMPS_PROXY_SERVICES_COMMAND_REPLIER_PROCESS_HPP
3 #include <memory>
4 #include <chrono>
5 #include <functional>
6 #include "umps/modules/process.hpp"
7 namespace UMPS
8 {
9  namespace Services::ConnectionInformation
10  {
11  class Requestor;
12  }
13  namespace Logging
14  {
15  class ILog;
16  }
17  namespace Messaging
18  {
19  class Context;
20  }
21  namespace MessageFormats
22  {
23  class IMessage;
24  }
25  namespace ProxyServices::Command
26  {
27  class ModuleDetails;
28  class ReplierOptions;
29  class Replier;
30  }
31 }
32 namespace UMPS::ProxyServices::Command
33 {
39 {
40 public:
43 
47  explicit ReplierProcess(std::shared_ptr<UMPS::Logging::ILog> &logger);
49  explicit ReplierProcess(std::shared_ptr<UMPS::Messaging::Context> &context);
51  ReplierProcess(std::shared_ptr<UMPS::Messaging::Context> &context,
52  std::shared_ptr<UMPS::Logging::ILog> &logger);
54 
57 
63  void initialize(const ReplierOptions &options);
65  [[nodiscard]] bool isInitialized() const noexcept;
67  [[nodiscard]] std::string getName() const noexcept override;
69 
72 
75  void start() override;
77  [[nodiscard]] bool isRunning() const noexcept override;
79 
82 
85  void stop() override;
87 
90 
92  ~ReplierProcess() override;
94 private:
95  class ReplierProcessImpl;
96  std::unique_ptr<ReplierProcessImpl> pImpl;
97 };
113 std::unique_ptr<ReplierProcess>
114  createReplierProcess(const UMPS::Services::ConnectionInformation::Requestor &requestor,
115  const ModuleDetails &moduleDetails,
116  const std::function<std::unique_ptr<UMPS::MessageFormats::IMessage>
117  (const std::string &messageType, const void *data, size_t length)> &callback,
118  const std::string &iniFile,
119  const std::string &section = "ModuleRegistry",
120  std::shared_ptr<UMPS::Messaging::Context> context = nullptr,
121  std::shared_ptr<UMPS::Logging::ILog> logger = nullptr);
122 }
123 #endif
A module is typically comprised of multiple processes. This defines the essential qualities that cons...
Definition: process.hpp:13
Defines the module properties.
Definition: moduleDetails.hpp:12
Defines the options for the thread managing remote activity to respond.
Definition: replierOptions.hpp:34
Definition: replierProcess.hpp:39
bool isRunning() const noexcept override
ReplierProcess(std::shared_ptr< UMPS::Logging::ILog > &logger)
Constructor with a given logger.
std::string getName() const noexcept override
ReplierProcess(std::shared_ptr< UMPS::Messaging::Context > &context, std::shared_ptr< UMPS::Logging::ILog > &logger)
Constructor with a given logger and context.
void initialize(const ReplierOptions &options)
Initializes the replier process.
void start() override
Starts the replier process.
ReplierProcess(std::shared_ptr< UMPS::Messaging::Context > &context)
Constructor with a given context.
void stop() override
Stops the replier process. This will send a shutdown message to the command module replier thread.
This class allows the user to interact with programs running remotely i.e., - on a different machine....
Definition: requestor.hpp:38