UMPS
The University of Utah Seismograph Stations Message Passing System.
failure.hpp
1 #ifndef UMPS_MESSAGE_FORMATS_FAILURE_HPP
2 #define UMPS_MESSAGE_FORMATS_FAILURE_HPP
3 #include <memory>
4 #include "umps/messageFormats/message.hpp"
5 namespace UMPS::MessageFormats
6 {
14 class Failure : public IMessage
15 {
16 public:
19 
25  Failure(const Failure &message);
30  Failure(Failure &&message) noexcept;
32 
35 
39  Failure& operator=(const Failure &message);
45  Failure& operator=(Failure &&message) noexcept;
47 
50  void setDetails(const std::string &details) noexcept;
52  [[nodiscard]] std::string getDetails() const noexcept;
53 
56 
62  [[nodiscard]] std::string toMessage() const final;
67  void fromMessage(const std::string &message) final;
74  void fromMessage(const char *data, size_t length) final;
76  [[nodiscard]] std::string getMessageType() const noexcept final;
78  [[nodiscard]] std::string getMessageVersion() const noexcept final;
80  [[nodiscard]] std::unique_ptr<UMPS::MessageFormats::IMessage> clone() const final;
82  [[nodiscard]] std::unique_ptr<UMPS::MessageFormats::IMessage> createInstance() const noexcept final;
86 
88  void clear() noexcept;
90  ~Failure() override;
92 private:
93  class FailureImpl;
94  std::unique_ptr<FailureImpl> pImpl;
95 };
96 }
97 #endif
This message is a general failure message. For generalized request-reply mechanisms,...
Definition: failure.hpp:15
std::unique_ptr< UMPS::MessageFormats::IMessage > clone() const final
Failure(Failure &&message) noexcept
Move constructor.
std::unique_ptr< UMPS::MessageFormats::IMessage > createInstance() const noexcept final
std::string getDetails() const noexcept
std::string getMessageType() const noexcept final
Failure & operator=(const Failure &message)
Copy assignment.
void setDetails(const std::string &details) noexcept
Sets the details of a failure message.
Failure & operator=(Failure &&message) noexcept
Move assignment.
void clear() noexcept
Resets the class and releases all memory.
void fromMessage(const std::string &message) final
Creates the class from a message.
std::string getMessageVersion() const noexcept final
std::string toMessage() const final
Converts the failure class to a string message.
Failure(const Failure &message)
Copy constructor.
An abstract base class defining the base requirements a message format must satisfy.
Definition: message.hpp:12