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) :
34  propertyName(propertyName)
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
str
std::string str(const T &t)
Definition: UserAssistedSegmenterGuiWidgetController.cpp:43
armarx::exceptions::local::MissingRequiredPropertyException::MissingRequiredPropertyException
MissingRequiredPropertyException(std::string propertyName, Ice::PropertiesPtr const &properties)
Definition: UnexpectedEnumValueException.cpp:31
UnexpectedEnumValueException.h
armarx::exceptions::local::UnexpectedEnumValueException::UnexpectedEnumValueException
UnexpectedEnumValueException(const std::string &enumName, int value)
Constructor.
Definition: UnexpectedEnumValueException.cpp:10
IceInternal::Handle<::Ice::Properties >
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
armarx::exceptions::local
Definition: DynamicLibraryException.h:31
armarx::exceptions::local::UnexpectedEnumValueException::getEnumName
const std::string & getEnumName() const
Get the name of the enum type.
Definition: UnexpectedEnumValueException.cpp:20
armarx::to_string
const std::string & to_string(const std::string &s)
Definition: StringHelpers.h:41
MissingRequiredPropertyException.h
std
Definition: Application.h:66
armarx::exceptions::local::MissingRequiredPropertyException::propertyName
std::string propertyName
Definition: MissingRequiredPropertyException.h:51
armarx::exceptions::local::UnexpectedEnumValueException::getValue
int getValue() const
Get the encountered enum value.
Definition: UnexpectedEnumValueException.cpp:26
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27