UnexpectedEnumValueException.cpp
Go to the documentation of this file.
2
3#include <Ice/Properties.h>
4
6
8{
9
11 int value) :
12 armarx::LocalException("Unexpected value of enum " + enumName + ": " +
13 std::to_string(value)),
14 enumName(enumName),
15 value(value)
16 {
17 }
18
19 const std::string&
21 {
22 return enumName;
23 }
24
25 int
27 {
28 return value;
29 }
30
32 std::string propertyName,
33 Ice::PropertiesPtr const& properties) :
35 {
36 std::stringstream str;
37 str << " Missing required property <" + propertyName + ">";
38
39 if (properties)
40 {
41 str << "\nAvailable Properties: " << properties->getPropertiesForPrefix("");
42 }
43
44 setReason(str.str());
45 }
46
47} // namespace armarx::exceptions::local
std::string str(const T &t)
MissingRequiredPropertyException(std::string propertyName, Ice::PropertiesPtr const &properties)
const std::string & getEnumName() const
Get the name of the enum type.
UnexpectedEnumValueException(const std::string &enumName, int value)
Constructor.
::IceInternal::Handle<::Ice::Properties > PropertiesPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
const std::string & to_string(const std::string &s)