MessageMismatchException.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <swarmros/Exception.h>
4 
5 namespace swarmros::bridge
6 {
13  {
14  private:
15 
20  std::string _topic;
21 
26  std::string _expectedMessage;
27 
32  std::string _actualMessage;
33 
34  public:
35 
44  MessageMismatchException(const char* message, const std::string& topic, const std::string& expectedMessage, const std::string& actualMessage)
45  : Exception(message), _topic(topic), _expectedMessage(expectedMessage), _actualMessage(actualMessage) { }
46 
52  const char* expected_message() const
53  {
54  return _expectedMessage.c_str();
55  }
56 
62  const char* actual_message() const
63  {
64  return _actualMessage.c_str();
65  }
66 
72  const char* topic() const
73  {
74  return _topic.c_str();
75  }
76  };
77 }
const char * topic() const
Get the actual message type.
MessageMismatchException(const char *message, const std::string &topic, const std::string &expectedMessage, const std::string &actualMessage)
Constructor.
Exception base class for swarmros exceptions.
std::string _actualMessage
The actual type of the variant.
const char * actual_message() const
Get the actual message type.
const char * expected_message() const
Get the expected message type.
Exception thrown when the expected type of a message does not match the actual type.
std::string _expectedMessage
The expected type of the variant.


swarmros
Author(s):
autogenerated on Fri Apr 3 2020 03:42:48