Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
UserException.h
1// Copyright (c) ZeroC, Inc.
2
3#ifndef ICE_USER_EXCEPTION_H
4#define ICE_USER_EXCEPTION_H
5
6#include "Exception.h"
7
8namespace Ice
9{
10 class InputStream;
11 class OutputStream;
12
13 /// Abstract base class for all Ice exceptions defined in Slice.
14 /// @headerfile Ice/Ice.h
15 class ICE_API UserException : public Exception
16 {
17 public:
18 /// Throws this exception.
19 virtual void ice_throw() const = 0;
20
21 /// Gets the Slice type ID of this user exception.
22 /// @return The Slice type ID.
23 [[nodiscard]] const char* what() const noexcept final;
24
25 void ice_print(std::ostream& os) const override;
26
27 /// Outputs the name and value of each field of this instance, including inherited fields, to the stream.
28 /// @param os The output stream.
29 virtual void ice_printFields(std::ostream& os) const;
30
31 /// @cond INTERNAL
32
33 // _write and _read are virtual for the Python, Ruby etc. mappings.
34 virtual void _write(OutputStream*) const;
35 virtual void _read(InputStream*);
36
37 [[nodiscard]] virtual bool _usesClasses() const;
38
39 protected:
40 virtual void _writeImpl(OutputStream*) const = 0;
41 virtual void _readImpl(InputStream*) = 0;
42 /// @endcond
43 };
44}
45
46#endif
Exception() noexcept=default
Default constructor.
Represents a byte buffer used for unmarshaling data encoded using the Slice encoding.
Definition InputStream.h:50
Represents a byte buffer used for marshaling data using the Slice encoding.
virtual void ice_printFields(std::ostream &os) const
Outputs the name and value of each field of this instance, including inherited fields,...
const char * what() const noexcept final
Gets the Slice type ID of this user exception.
virtual void ice_throw() const =0
Throws this exception.
void ice_print(std::ostream &os) const override
Outputs a description of this exception to a stream.
Abstract base class for all Ice exceptions defined in Slice.
The Ice RPC framework.
Definition SampleEvent.h:59