TypeMismatchException.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <swarmio/data/Variant.pb.h>
5 
7 {
14  {
15  private:
16 
21  swarmio::data::Variant::ValueCase _expectedType;
22 
27  swarmio::data::Variant::ValueCase _actualType;
28 
29  public:
30 
39  TypeMismatchException(const char* message, const std::string& location, swarmio::data::Variant::ValueCase expectedType, swarmio::data::Variant::ValueCase actualType)
40  : SchemaMismatchException(message, location), _expectedType(expectedType), _actualType(actualType) { }
41 
47  swarmio::data::Variant::ValueCase expected_type() const
48  {
49  return _expectedType;
50  }
51 
57  swarmio::data::Variant::ValueCase actual_type() const
58  {
59  return _actualType;
60  }
61  };
62 }
TypeMismatchException(const char *message, const std::string &location, swarmio::data::Variant::ValueCase expectedType, swarmio::data::Variant::ValueCase actualType)
Constructor.
swarmio::data::Variant::ValueCase actual_type() const
Get the actual type of the Variant.
Exception thrown when the schema does not match the variant.
swarmio::data::Variant::ValueCase expected_type() const
Get the expected type of the Variant.
Exception thrown when the expected type of the Variant does not match the actual type.
const char * location() const
Get the location of the mismatch.
swarmio::data::Variant::ValueCase _expectedType
The expected type of the variant.
swarmio::data::Variant::ValueCase _actualType
The actual type of the variant.


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