cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
msgpack_rpc::methods::MethodException Class Reference

Class of exceptions in methods. More...

#include <msgpack_rpc/methods/method_exception.h>

Inheritance diagram for msgpack_rpc::methods::MethodException:
Collaboration diagram for msgpack_rpc::methods::MethodException:

Public Member Functions

 MethodException (const MethodException &) noexcept
 Copy constructor.
 MethodException (MethodException &&) noexcept
 Move constructor.
template<typename T>
 MethodException (T &&object, std::enable_if_t<!std::is_same_v< std::decay_t< T >, MethodException >, void * >=nullptr)
 Constructor.
 ~MethodException () noexcept override
 Destructor.
const msgpack::object & object () const noexcept
 Get the object in msgpack library.
MethodExceptionoperator= (const MethodException &) noexcept
 Copy assignment operator.
MethodExceptionoperator= (MethodException &&) noexcept
 Move assignment operator.
const char * what () const noexcept override
 Get the message of this exception.

Private Attributes

msgpack::object object_
 Object in msgpack library.
std::shared_ptr< msgpack::zone > zone_
 Zone in msgpack library.

Detailed Description

Class of exceptions in methods.

Note
Methods can throw this exception to notify errors using any serializable objects.
Examples
more_server.cpp.

Definition at line 39 of file method_exception.h.

Constructor & Destructor Documentation

◆ MethodException()

template<typename T>
msgpack_rpc::methods::MethodException::MethodException ( T && object,
std::enable_if_t<!std::is_same_v< std::decay_t< T >, MethodException >, void * > = nullptr )
inlineexplicit

Constructor.

Template Parameters
TObject specifying the error.
Parameters
objectObject specifying the error.
Note
The second argument is for SFINAE, so the second argument should be left unspecified.

Definition at line 54 of file method_exception.h.

Member Function Documentation

◆ object()

const msgpack::object & msgpack_rpc::methods::MethodException::object ( ) const
nodiscardnoexcept

Get the object in msgpack library.

Returns
Object in msgpack library.

Definition at line 24 of file method_exception.cpp.

◆ operator=() [1/2]

MethodException & msgpack_rpc::methods::MethodException::operator= ( const MethodException & )
defaultnoexcept

Copy assignment operator.

Returns
This.

◆ operator=() [2/2]

MethodException & msgpack_rpc::methods::MethodException::operator= ( MethodException && )
defaultnoexcept

Move assignment operator.

Returns
This.

◆ what()

const char * msgpack_rpc::methods::MethodException::what ( ) const
nodiscardoverridenoexcept

Get the message of this exception.

Returns
Message.

Definition at line 28 of file method_exception.cpp.

Member Data Documentation

◆ object_

msgpack::object msgpack_rpc::methods::MethodException::object_
private

Object in msgpack library.

Definition at line 107 of file method_exception.h.

◆ zone_

std::shared_ptr<msgpack::zone> msgpack_rpc::methods::MethodException::zone_
private

Zone in msgpack library.

Definition at line 104 of file method_exception.h.


The documentation for this class was generated from the following files: