C++11 Mapping for Local Exceptions
On this page:
Mapped C++ Class
A local Slice exception is mapped to a C++ class with the same name. For example:
Slice
module Ice { local exception InitializationException { ... } }
is mapped to the C++ class InitializationException:
C++
namespace Ice { class InitializationException : public Ice::LocalException { ... }; }
Base Class for Local Exceptions in C++
All mapped C++ exception classes derive directly or indirectly from Ice::LocalException
:
C++
namespace Ice { class LocalException : public Exception { public: LocalException(const char*, int); LocalException(const LocalException&) = default; virtual ~LocalException(); std::unique_ptr<LocalException> ice_clone() const; static const std::string& ice_staticId(); }; }
All these member functions are described on the C++11 Mapping for Exceptions page.
Mapping for Local Exception Inheritance in C++
A local Slice exception can extend another Slice exception. In C++, this is mapped to simple public inheritance. For example:
Slice
module M { local exception ErrorBase {} local exception ResourceError extends ErrorBase {} }
is mapped to:
C++
namespace M { class ErrorBase : public Ice::LocalException { ... }; class ResourceError : public ErrorBase { ... }; }