CppWAMP
C++11 client library for the WAMP protocol
wamp Namespace Reference

Namespaces

 error
 

Classes

class  Abort
 Provides the reason URI and other options contained within ABORT messages. More...
 
class  AnyReusableHandler
 Type-erases a multi-shot, copyable callback handler. More...
 
class  Authentication
 Provides the Signature and Extra dictionary contained within WAMP AUTHENTICATE messages. More...
 
class  BasicCborDecoder
 CBOR decoder. More...
 
class  BasicCborDecoder< I, StreamInputCategory >
 CBOR decoder specialization for stream inputs. More...
 
class  BasicCborEncoder
 CBOR encoder. More...
 
class  BasicCborEncoder< O, StreamOutputCategory >
 CBOR encoder specialization for streams. More...
 
class  BasicJsonDecoder
 JSON decoder. More...
 
class  BasicJsonDecoder< I, StreamInputCategory >
 JSON decoder specialization for stream inputs. More...
 
class  BasicJsonEncoder
 JSON encoder. More...
 
class  BasicMsgpackDecoder
 Decoder specialization for Msgpack. More...
 
class  BasicMsgpackDecoder< I, StreamInputCategory >
 Decoder specialization for Msgpack and stream inputs. More...
 
class  BasicMsgpackEncoder
 Msgpack encoder. More...
 
class  BasicMsgpackEncoder< O, StreamOutputCategory >
 Msgpack encoder specialization for streams. More...
 
class  Blob
 Contains binary data as an array of bytes. More...
 
struct  ByteArrayInputCategory
 Input category for contiguous byte arrays which provide data and size member functions. More...
 
struct  ByteContainerOutputCategory
 Output category for containers of bytes which provide push_back and insert member functions. More...
 
class  CallCancellation
 Contains the request ID and options contained within WAMP CANCEL messages. More...
 
class  CallChit
 Lightweight token representing a call request. More...
 
struct  Cbor
 CBOR format tag type. More...
 
class  Challenge
 Provides the AuthMethod and Extra dictionary contained within WAMP CHALLENGE messages. More...
 
class  Connector
 Abstract base class for establishing client transport endpoints. More...
 
class  ConversionAccess
 Helper class used to gain access to private conversion member functions. More...
 
class  CoroEventUnpacker
 Wrapper around an event coroutine slot which automatically unpacks positional payload arguments. More...
 
class  CoroInvocationUnpacker
 Wrapper around a call coroutine slot which automatically unpacks positional payload arguments. More...
 
class  CoroSession
 Coroutine API used by a client peer in WAMP applications. More...
 
class  DecodingCategory
 std::error_category used for reporting deserialization errors. More...
 
struct  Deferment
 Tag type that can be passed to wamp::Outcome to construct a deferred outcome. More...
 
class  Error
 Provides the reason URI, options, and payload arguments contained within WAMP ERROR messages. More...
 
class  ErrorOr
 Minimalistic implementation of std::expected<T, std::error_code> More...
 
class  Event
 Provides the subscription/publication ids, options, and payload contained within WAMP EVENT messages. More...
 
class  EventUnpacker
 Wrapper around an event slot which automatically unpacks positional payload arguments. More...
 
class  FromVariantConverter
 Wrapper around a source Variant, used for conversions. More...
 
struct  InputCategory
 Traits class that determines the category type that best matches the given input type. More...
 
class  Interruption
 Contains details within WAMP INTERRUPT messages. More...
 
class  Invocation
 Contains payload arguments and other options within WAMP INVOCATION messages. More...
 
class  InvocationUnpacker
 Wrapper around a call slot which automatically unpacks positional payload arguments. More...
 
struct  Json
 JSON format tag type. More...
 
struct  KnownCodecIds
 IDs used by rawsocket transports to negotiate the serializer. More...
 
struct  Msgpack
 Msgpack format tag type. More...
 
struct  Null
 Type used to represent a null or empty Variant value. More...
 
class  Options
 Wrapper around a WAMP message containing an options dictionary. More...
 
class  Outcome
 Contains the outcome of an RPC invocation. More...
 
struct  OutputCategory
 Traits class that determines the category type that best matches the given output type. More...
 
class  Payload
 Wrapper around a WAMP message containing payload arguments and an options dictionary. More...
 
class  Procedure
 Contains the procedure URI and other options contained within WAMP REGISTER messages. More...
 
class  ProtocolCategory
 std::error_category used for reporting protocol errors related to invalid WAMP messages. More...
 
class  Pub
 Provides the topic URI, options, and payload contained within WAMP PUBLISH messages. More...
 
class  RawsockCategory
 std::error_category used for reporting errors specific to raw socket transports. More...
 
class  Realm
 Realm URI and other options contained within WAMP HELLO messages. More...
 
class  Reason
 Provides the reason URI and other options contained within GOODBYE messages. More...
 
class  Registration
 Represents a remote procedure registration. More...
 
class  Result
 Contains the remote procedure result options/payload within WAMP RESULT and YIELD messages. More...
 
class  Rpc
 Contains the procedure URI, options, and payload contained within WAMP CALL messages. More...
 
class  ScopedRegistration
 Limits a Registration's lifetime to a particular scope. More...
 
class  ScopedSubscription
 Limits a Subscription's lifetime to a particular scope. More...
 
class  Session
 Session API used by a client peer in WAMP applications. More...
 
class  SessionCategory
 std::error_category used for reporting errors at the WAMP session layer. More...
 
class  SessionInfo
 Session information contained within WAMP WELCOME messages. More...
 
class  SimpleCoroEventUnpacker
 Wrapper around an event slot which automatically unpacks positional payload arguments. More...
 
class  SimpleCoroInvocationUnpacker
 Wrapper around a call slot which automatically unpacks positional payload arguments. More...
 
class  SimpleEventUnpacker
 Wrapper around an event slot which automatically unpacks positional payload arguments. More...
 
class  SimpleInvocationUnpacker
 Wrapper around a call slot which automatically unpacks positional payload arguments. More...
 
struct  StreamInputCategory
 Input category for input streams of bytes. More...
 
struct  StreamOutputCategory
 Output category for output streams of bytes. More...
 
class  Subscription
 Represents a pub/sub event subscription. More...
 
class  TcpHost
 Contains TCP host address information, as well as other socket options. More...
 
class  TcpOptions
 Contains options for the TCP transport. More...
 
struct  ThreadSafe
 Tag type used to specify than an operation is to be dispatched via the called objects's execution strand. More...
 
class  Topic
 Provides the topic URI and other options contained within WAMP ‘SUBSCRIBE’ messages. More...
 
class  ToVariantConverter
 Wrapper around a destination Variant, used for conversions. More...
 
class  TransportCategory
 std::error_category used for reporting errors at the transport layer. More...
 
class  UdsOptions
 Contains options for the UNIX domain socket transport. More...
 
class  UdsPath
 Contains a Unix domain socket path, as well as other socket options. More...
 
class  Unexpected
 Minimalistic implementation of std::unexpected<std::error_code>. More...
 
struct  UnknownInputCategory
 Type used to indicate input category detection failed. More...
 
struct  UnknownOutputCategory
 Type used to indicate output category detection failed. More...
 
class  Variant
 Discriminated union container that represents a JSON value. More...
 
struct  Version
 Bundles the major, minor, and patch version numbers. More...
 
class  Visitor
 Convenience base class used to meet the result type requirements of a StaticVisitor. More...
 

Typedefs

using AnyCompletionExecutor = boost::asio::any_completion_executor
 Type-erases an executor that is to be used with type-erased handlers.
 
template<typename TSignature >
using AnyCompletionHandler = boost::asio::any_completion_handler< TSignature >
 Type-erases a one-shot (and possibly move-only) asynchronous completion handler. More...
 
using AnyIoExecutor = boost::asio::any_io_executor
 Polymorphic executor for all I/O objects.
 
using AnyExecutor = AnyIoExecutor
 Alias of AnyIoExecutor kept for backward compatibility. More...
 
using AsioContext = boost::asio::io_context
 Queues and runs I/O completion handlers.
 
using AsioService = AsioContext
 Alias of AsioContext kept for backward compatibility. More...
 
using IoStrand = boost::asio::strand< AnyIoExecutor >
 Serializes I/O operations.
 
using AsioErrorCode = boost::system::error_code
 Type used by Boost.Asio for reporting errors.
 
template<typename T >
using AsyncResult = ErrorOr< T >
 
using CborStringEncoder = BasicCborEncoder< std::string >
 CBOR encoder type that encodes into a std::string. *‍/.
 
using CborBufferEncoder = BasicCborEncoder< MessageBuffer >
 CBOR encoder type that encodes into a MessageBuffer. *‍/.
 
using CborStreamEncoder = BasicCborEncoder< std::ostream >
 CBOR encoder type that encodes into a std::ostream. *‍/.
 
using CborStringDecoder = BasicCborDecoder< std::string >
 CBOR decoder type that decodes from a std::string. *‍/.
 
using CborBufferDecoder = BasicCborDecoder< MessageBuffer >
 CBOR decoder type that decodes from a MessageBuffer. *‍/.
 
using CborStreamDecoder = BasicCborDecoder< std::istream >
 CBOR decoder type that decodes from a std::istream. *‍/.
 
template<typename O >
using OutputCategoryTypeOf = typename OutputCategory< ValueTypeOf< O > >::type
 Yields the category type that best matches the given output type.
 
template<typename F , typename O , typename C = OutputCategoryTypeOf<O>>
using Encoder = typename F::template Encoder< ValueTypeOf< O >, C >
 Yields the encoder type needed to encode a Variant to the given output type and output category. More...
 
template<typename I >
using InputCategoryTypeOf = typename InputCategory< ValueTypeOf< I > >::type
 Yields the category type that best matches the given input type.
 
template<typename F , typename I , typename C = InputCategoryTypeOf<I>>
using Decoder = typename F::template Decoder< ValueTypeOf< I >, C >
 Yields the decoder type needed to decode a Variant from the given input type and input category. More...
 
using ConnectorList = std::vector< Connector::Ptr >
 List of Connector objects to use when attempting connection.
 
template<typename TSlot , typename... TArgs>
using BasicCoroEventUnpacker = SimpleCoroEventUnpacker< TSlot, TArgs... >
 Alias to SimpleCoroEventUnpacker kept for backward compatibility. More...
 
template<typename TSlot , typename TResult , typename... TArgs>
using BasicCoroInvocationUnpacker = SimpleCoroInvocationUnpacker< TSlot, TResult, TArgs... >
 Alias to SimpleCoroInvocationUnpacker kept for backward compability. More...
 
using UnexpectedError = Unexpected< std::error_code >
 Type alias for Unexpected<std::error_code>.
 
template<typename T >
using AsyncHandler = std::function< void(ErrorOr< T >)>
 Type alias for a handler taking an ErrorOr<T> parameter.
 
using JsonStringEncoder = BasicJsonEncoder< std::string >
 JSON encoder type that encodes into a std::string. *‍/.
 
using JsonBufferEncoder = BasicJsonEncoder< MessageBuffer >
 JSON encoder type that encodes into a MessageBuffer. *‍/.
 
using JsonStreamEncoder = BasicJsonEncoder< std::ostream >
 JSON encoder type that encodes into a std::ostream. *‍/.
 
using JsonStringDecoder = BasicJsonDecoder< std::string >
 JSON decoder type that decodes from a std::string. *‍/.
 
using JsonBufferDecoder = BasicJsonDecoder< MessageBuffer >
 JSON decoder type that decodes from a MessageBuffer. *‍/.
 
using JsonStreamDecoder = BasicJsonDecoder< std::istream >
 JSON decoder type that decodes from a std::ostream. *‍/.
 
using MessageBuffer = std::vector< uint8_t >
 Container type used for encoded WAMP messages that are sent/received over a transport.
 
using MsgpackStringEncoder = BasicMsgpackEncoder< std::string >
 Msgpack encoder type that encodes into a std::string. *‍/.
 
using MsgpackBufferEncoder = BasicMsgpackEncoder< MessageBuffer >
 Msgpack encoder type that encodes into a MessageBuffer. *‍/.
 
using MsgpackStreamEncoder = BasicMsgpackEncoder< std::ostream >
 Msgpack encoder type that encodes into a std::ostream. *‍/.
 
using MsgpackStringDecoder = BasicMsgpackDecoder< std::string >
 Msgpack decoder type that decodes from a std::string. *‍/.
 
using MsgpackBufferDecoder = BasicMsgpackDecoder< MessageBuffer >
 Msgpack decoder type that decodes from a MessageBuffer. *‍/.
 
using MsgpackStreamDecoder = BasicMsgpackDecoder< std::istream >
 Msgpack decoder type that decodes from a std::ostream. *‍/.
 
using Cancellation = CallCancellation
 Alias of CallCancellation kept for backward compatiblity. More...
 
template<bool B, typename T = int>
using EnableIf = typename std::enable_if< B, T >::type
 Metafunction used to enable overloads based on a boolean condition.
 
template<bool B, typename T = int>
using DisableIf = typename std::enable_if<!B, T >::type
 Metafunction used to disable overloads based on a boolean condition.
 
template<typename T >
using ValueTypeOf = typename std::remove_cv< typename std::remove_reference< T >::type >::type
 Metafunction used to obtain the plain value type of a parameter passed by universal reference.
 
template<int N, typename... Ts>
using NthTypeOf = typename std::tuple_element< N, std::tuple< Ts... > >::type
 Metafunction that obtains the Nth type of a parameter pack.
 
template<bool B>
using BoolConstant = std::integral_constant< bool, B >
 Equivalent to std::bool_constant provided in C++17.
 
using TrueType = BoolConstant< true >
 Equivalent to std::true_type provided in C++17.
 
using FalseType = BoolConstant< false >
 Equivalent to std::false_type provided in C++17.
 
template<typename TSlot >
using DecayedSlot = typename std::decay< TSlot >::type
 Metafunction that removes const/reference decorations off a slot type.
 
template<typename TSlot , typename... TArgs>
using BasicEventUnpacker = SimpleEventUnpacker< TSlot, TArgs... >
 Alias to SimpleEventUnpacker kept for backward compatiblity. More...
 
template<typename TSlot , typename TResult , typename... TArgs>
using BasicInvocationUnpacker = SimpleInvocationUnpacker< TSlot, TResult, TArgs... >
 Alias to SimpleInvocationUnpacker kept for backward compability. More...
 
using SessionId = int64_t
 Ephemeral ID associated with a WAMP session.
 
using RequestId = int64_t
 Ephemeral ID associated with a WAMP request.
 
using SubscriptionId = int64_t
 Ephemeral ID associated with an topic subscription.
 
using PublicationId = int64_t
 Ephemeral ID associated with an event publication.
 
using RegistrationId = int64_t
 Obtains the value representing a blank RequestId.
 
using CancelMode = CallCancelMode
 Alias to CallCancelMode kept for backward compatibility. More...
 

Enumerations

enum  SessionErrc {
  SessionErrc::success = 0,
  SessionErrc::sessionEnded,
  SessionErrc::sessionEndedByPeer,
  SessionErrc::allTransportsFailed,
  SessionErrc::joinError,
  SessionErrc::publishError,
  SessionErrc::subscribeError,
  SessionErrc::unsubscribeError,
  SessionErrc::registerError,
  SessionErrc::unregisterError,
  SessionErrc::callError,
  SessionErrc::invalidState,
  SessionErrc::invalidUri,
  SessionErrc::noSuchProcedure,
  SessionErrc::procedureAlreadyExists,
  SessionErrc::noSuchRegistration,
  SessionErrc::noSuchSubscription,
  SessionErrc::invalidArgument,
  SessionErrc::systemShutdown,
  SessionErrc::closeRealm,
  SessionErrc::goodbyeAndOut,
  SessionErrc::notAuthorized,
  SessionErrc::authorizationFailed,
  SessionErrc::noSuchRealm,
  SessionErrc::noSuchRole,
  SessionErrc::cancelled,
  SessionErrc::optionNotAllowed,
  SessionErrc::noEligibleCallee,
  SessionErrc::discloseMeDisallowed,
  SessionErrc::networkFailure
}
 Error code values used with the SessionCategory error category. More...
 
enum  DecodingErrc {
  DecodingErrc::success = 0,
  DecodingErrc::failure = 1,
  DecodingErrc::emptyInput = 2,
  DecodingErrc::expectedStringKey = 3,
  DecodingErrc::badBase64Length = 4,
  DecodingErrc::badBase64Padding = 5,
  DecodingErrc::badBase64Char = 6
}
 Error code values used with the DecodingCategory error category. More...
 
enum  ProtocolErrc {
  ProtocolErrc::success = 0,
  ProtocolErrc::badDecode,
  ProtocolErrc::badSchema,
  ProtocolErrc::unsupportedMsg,
  ProtocolErrc::unexpectedMsg
}
 Error code values used with the ProtocolCategory error category. More...
 
enum  TransportErrc {
  TransportErrc::success = 0,
  TransportErrc::aborted = 1,
  TransportErrc::failed = 2,
  TransportErrc::badTxLength = 3,
  TransportErrc::badRxLength = 4
}
 Error code values used with the TransportCategory error category. More...
 
enum  RawsockErrc {
  RawsockErrc::success = 0,
  RawsockErrc::badSerializer = 1,
  RawsockErrc::badMaxLength = 2,
  RawsockErrc::reservedBitsUsed = 3,
  RawsockErrc::maxConnectionsReached = 4,
  RawsockErrc::badHandshake = 16,
  RawsockErrc::badMessageType = 17
}
 Error code values used with the RawsockCategory error category. More...
 
enum  RawsockMaxLength {
  RawsockMaxLength::B_512,
  RawsockMaxLength::kB_1,
  RawsockMaxLength::kB_2,
  RawsockMaxLength::kB_4,
  RawsockMaxLength::kB_8,
  RawsockMaxLength::kB_16,
  RawsockMaxLength::kB_32,
  RawsockMaxLength::kB_64,
  RawsockMaxLength::kB_128,
  RawsockMaxLength::kB_256,
  RawsockMaxLength::kB_512,
  RawsockMaxLength::MB_1,
  RawsockMaxLength::MB_2,
  RawsockMaxLength::MB_4,
  RawsockMaxLength::MB_8,
  RawsockMaxLength::MB_16
}
 Enumerators used to specify the maximum length of messages that a raw socket transport can receive. More...
 
enum  TypeId : uint8_t {
  TypeId::null,
  TypeId::boolean,
  TypeId::integer,
  TypeId::uint,
  TypeId::real,
  TypeId::string,
  TypeId::blob,
  TypeId::array,
  TypeId::object
}
 Integer ID used to indicate the current dynamic type of a Variant. More...
 
enum  SessionState {
  SessionState::disconnected,
  SessionState::connecting,
  SessionState::closed,
  SessionState::establishing,
  SessionState::authenticating,
  SessionState::established,
  SessionState::shuttingDown,
  SessionState::failed
}
 Enumerates the possible states that a client or router session can be in. More...
 
enum  CallCancelMode {
  CallCancelMode::kill,
  CallCancelMode::killNoWait,
  CallCancelMode::skip
}
 Enumerates the possible call cancelling modes. More...
 

Functions

template<typename F , typename... Ts>
void dispatchAny (F &&handler, Ts &&... args)
 Dispatches the given handler using its associated executor, passing the given arguments.
 
template<typename F , typename E , typename... Ts>
void dispatchVia (const E &fallbackExec, F &&handler, Ts &&... args)
 Dispatches the given handler using the given fallback executor, passing the given arguments.
 
template<typename F , typename... Ts>
void postAny (F &&handler, Ts &&... args)
 Posts the given handler using its associated executor, passing the given arguments.
 
template<typename F , typename E , typename... Ts>
void postVia (const E &fallbackExec, F &&handler, Ts &&... args)
 Posts the given handler using the given fallback executor, passing the given arguments.
 
template<typename F , typename... Ts>
void deferAny (F &&handler, Ts &&... args)
 Defers the given handler using its associated executor, passing the given arguments.
 
template<typename F , typename E , typename... Ts>
void deferVia (const E &fallbackExec, F &&handler, Ts &&... args)
 Defers the given handler using the given fallback executor, passing the given arguments.
 
template<typename TFormat , typename TOutput >
void encode (const Variant &variant, TOutput &&output)
 Encodes the given variant to the given byte container or stream. More...
 
template<typename TFormat , typename TInput >
std::error_code decode (TInput &&input, Variant &variant)
 Decodes from the given byte sequence or stream to the given variant. More...
 
template<typename... TArgs, typename TSlot >
SimpleCoroEventUnpacker< DecayedSlot< TSlot >, TArgs... > basicCoroEvent (TSlot &&slot)
 
template<typename TResult , typename... TArgs, typename TSlot >
SimpleCoroInvocationUnpacker< DecayedSlot< TSlot >, TResult, TArgs... > basicCoroRpc (TSlot &&slot)
 
template<typename TErrorEnum >
UnexpectedError makeUnexpectedError (TErrorEnum errc)
 Convenience function that creates an UnexpectedError from an error code enum.
 
template<typename T , typename U >
constexpr bool isSameType ()
 Determines if a type is the same as another.
 
template<typename T >
constexpr bool isBool ()
 Determines if the given type is considered a boolean.
 
template<typename T >
constexpr bool isNumber ()
 Determines if the given type is considered a number. More...
 
template<typename T >
constexpr bool isSignedInteger ()
 Determines if the given type is a signed integer.
 
template<typename T >
constexpr bool isUnsignedInteger ()
 Determines if the given type is an unsigned integer.
 
template<typename... TArgs, typename TSlot >
SimpleEventUnpacker< DecayedSlot< TSlot >, TArgs... > basicEvent (TSlot &&slot)
 
template<typename TResult , typename... TArgs, typename TSlot >
SimpleInvocationUnpacker< DecayedSlot< TSlot >, TResult, TArgs... > basicRpc (TSlot &&slot)
 
template<typename TConverter , typename TValue , DisableIf< std::is_enum< TValue >::value > = 0>
void convert (TConverter &c, TValue &val)
 General function for converting custom types to/from Variant. More...
 
template<typename TEnum , EnableIf< std::is_enum< TEnum >::value > = 0>
void convert (const FromVariantConverter &c, TEnum &e)
 Converts an integer variant to an enumerator.
 
template<typename TEnum , EnableIf< std::is_enum< TEnum >::value > = 0>
void convert (ToVariantConverter &c, const TEnum &e)
 Converts an enumerator to an integer variant.
 
bool lookupWampErrorUri (const std::string &uri, SessionErrc fallback, SessionErrc &result)
 
template<typename T , std::size_t Size>
void convert (FromVariantConverter &conv, std::array< T, Size > &array)
 Performs the conversion from an array variant to a std::array. More...
 
template<typename T , std::size_t Size>
void convert (ToVariantConverter &conv, std::array< T, Size > &array)
 Performs the conversion from a std::array to an array variant. More...
 
template<typename T >
void convert (FromVariantConverter &conv, boost::optional< T > &opt)
 Performs the conversion from a variant to a boost::optional. More...
 
template<typename T >
void convert (ToVariantConverter &conv, boost::optional< T > &opt)
 Performs the conversion from a boost::optional to a variant. More...
 
template<typename T >
bool operator== (const Variant &v, const boost::optional< T > o)
 Compares a variant and a boost::optional for equality.
 
template<typename T >
bool operator== (const boost::optional< T > o, const Variant &v)
 Compares a variant and a boost::optional for equality.
 
template<typename T >
bool operator!= (const Variant &v, const boost::optional< T > o)
 Compares a variant and a boost::optional for inequality.
 
template<typename T >
bool operator!= (const boost::optional< T > o, const Variant &v)
 Compares a variant and a boost::optional for inequality.
 
template<typename T >
void convert (FromVariantConverter &conv, std::optional< T > &opt)
 Performs the conversion from a variant to a std::optional. More...
 
template<typename T >
void convert (ToVariantConverter &conv, std::optional< T > &opt)
 Performs the conversion from a std::optional to a variant. More...
 
template<typename T >
bool operator== (const Variant &v, const std::optional< T > o)
 Compares a variant and a std::optional for equality.
 
template<typename T >
bool operator== (const std::optional< T > o, const Variant &v)
 Compares a variant and a std::optional for equality.
 
template<typename T >
bool operator!= (const Variant &v, const std::optional< T > o)
 Compares a variant and a std::optional for inequality.
 
template<typename T >
bool operator!= (const std::optional< T > o, const Variant &v)
 Compares a variant and a std::optional for inequality.
 
template<typename T >
void convert (FromVariantConverter &conv, std::set< T > &set)
 Performs the conversion from an array variant to a std::set. More...
 
template<typename T >
void convert (ToVariantConverter &conv, std::set< T > &set)
 Performs the conversion from a std::set to an array variant. More...
 
template<typename... Ts>
void toTuple (const wamp::Variant::Array &array, std::tuple< Ts... > &tuple)
 Converts a Variant::Array to a std::tuple. More...
 
template<typename... Ts>
wamp::Variant::Array toArray (const std::tuple< Ts... > &tuple)
 Converts a std::tuple to a Variant::Array. More...
 
template<typename... Ts>
void convert (FromVariantConverter &conv, std::tuple< Ts... > &tuple)
 Performs the conversion from an array variant to a std::tuple. More...
 
template<typename... Ts>
void convert (ToVariantConverter &conv, std::tuple< Ts... > &tuple)
 Performs the conversion from a std::tuple to an array variant. More...
 
template<typename... Ts>
bool operator== (const Array &array, const std::tuple< Ts... > &tuple)
 Compares a Variant::Array and a std::tuple for equality.
 
template<typename... Ts>
bool operator== (const std::tuple< Ts... > &tuple, const Array &array)
 Compares a std::tuple and a Variant::Array for equality.
 
template<typename... Ts>
bool operator!= (const Array &array, const std::tuple< Ts... > &tuple)
 Compares a Variant::Array and a std::tuple for inequality.
 
template<typename... Ts>
bool operator!= (const std::tuple< Ts... > &tuple, const Array &array)
 Compares a std::tuple and a Variant::Array for inequality.
 
template<typename... Ts>
bool operator== (const Variant &variant, const std::tuple< Ts... > &tuple)
 Compares a Variant and a std::tuple for equality.
 
template<typename... Ts>
bool operator== (const std::tuple< Ts... > &tuple, const Variant &variant)
 Compares a std::tuple and a Variant for equality.
 
template<typename... Ts>
bool operator!= (const Variant &variant, const std::tuple< Ts... > &tuple)
 Compares a Variant and a std::tuple for inequality.
 
template<typename... Ts>
bool operator!= (const std::tuple< Ts... > &tuple, const Variant &variant)
 Compares a std::tuple and a Variant for inequality.
 
template<typename T >
void convert (FromVariantConverter &conv, std::unordered_map< String, T > &map)
 Performs the conversion from an object variant to a std::unordered_map. More...
 
template<typename T >
void convert (ToVariantConverter &conv, std::unordered_map< String, T > &map)
 Performs the conversion from a std::unordered_map to an object variant. More...
 
template<typename T >
void convert (FromVariantConverter &conv, std::unordered_set< T > &set)
 Performs the conversion from an array variant to a std::unordered_set. More...
 
template<typename T >
void convert (ToVariantConverter &conv, std::unordered_set< T > &set)
 Performs the conversion from a std::unordered_set to an array variant. More...
 

Variables

constexpr Null null
 Constant Null object that can be assigned to, or compared with a Variant.
 
constexpr Deferment deferment
 Convenient value of the wamp::Deferment tag type that can be passed to the wamp::Outcome constructor.
 
constexpr ThreadSafe threadSafe
 Constant ThreadSafe object instance that can be passed to functions.
 

Detailed Description

Namespace for all identifiers defined by the CppWAMP library.


Class Documentation

◆ wamp::ByteArrayInputCategory

struct wamp::ByteArrayInputCategory

Input category for contiguous byte arrays which provide data and size member functions.

◆ wamp::ByteContainerOutputCategory

struct wamp::ByteContainerOutputCategory

Output category for containers of bytes which provide push_back and insert member functions.

◆ wamp::InputCategory

struct wamp::InputCategory

template<typename I, typename Enabled = void>
struct wamp::InputCategory< I, Enabled >

Traits class that determines the category type that best matches the given input type.

◆ wamp::OutputCategory

struct wamp::OutputCategory

template<typename O, typename Enabled = void>
struct wamp::OutputCategory< O, Enabled >

Traits class that determines the category type that best matches the given output type.

◆ wamp::StreamInputCategory

struct wamp::StreamInputCategory

Input category for input streams of bytes.

◆ wamp::StreamOutputCategory

struct wamp::StreamOutputCategory

Output category for output streams of bytes.

◆ wamp::UnknownInputCategory

struct wamp::UnknownInputCategory

Type used to indicate input category detection failed.

◆ wamp::UnknownOutputCategory

struct wamp::UnknownOutputCategory

Type used to indicate output category detection failed.

◆ wamp::Visitor

class wamp::Visitor

template<typename TResult = void>
class wamp::Visitor< TResult >

Convenience base class used to meet the result type requirements of a StaticVisitor.

Class Members
typedef TResult Result The return type for all of the visitor's dispatch functions.

Typedef Documentation

◆ AnyCompletionHandler

template<typename TSignature >
using wamp::AnyCompletionHandler = typedef boost::asio::any_completion_handler<TSignature>

Type-erases a one-shot (and possibly move-only) asynchronous completion handler.

The executor associated with the type-erased handler can be obtained via boost::asio::get_associated_executor.

See also
AnyCompletionExecutor
AnyReusableHandler

◆ AnyExecutor

Alias of AnyIoExecutor kept for backward compatibility.

Deprecated:
Use wamp::AnyIoExecutor instead.

◆ AsioService

using wamp::AsioService = typedef AsioContext

Alias of AsioContext kept for backward compatibility.

Deprecated:
Use wamp::AsioContext instead.

◆ AsyncResult

template<typename T >
using wamp::AsyncResult = typedef ErrorOr<T>
Deprecated:
Backward compatiblity type alias.

◆ Encoder

template<typename F , typename O , typename C = OutputCategoryTypeOf<O>>
using wamp::Encoder = typedef typename F::template Encoder<ValueTypeOf<O>, C>

Yields the encoder type needed to encode a Variant to the given output type and output category.

Template Parameters
FEncoder format type tag (e.g. Json)
OOutput type (e.g. std::string)
COutput category (deduced)
See also
wamp::Decoder
wamp::encode

◆ Decoder

template<typename F , typename I , typename C = InputCategoryTypeOf<I>>
using wamp::Decoder = typedef typename F::template Decoder<ValueTypeOf<I>, C>

Yields the decoder type needed to decode a Variant from the given input type and input category.

Template Parameters
FEncoder format type tag (e.g. Json)
IInput type (e.g. std::string)
IInput category (deduced)
See also
wamp::Encoder
wamp::decode

◆ BasicCoroEventUnpacker

template<typename TSlot , typename... TArgs>
using wamp::BasicCoroEventUnpacker = typedef SimpleCoroEventUnpacker<TSlot, TArgs...>

Alias to SimpleCoroEventUnpacker kept for backward compatibility.

Deprecated:
Use SimpleCoroEventUnpacker instead.

◆ BasicCoroInvocationUnpacker

template<typename TSlot , typename TResult , typename... TArgs>
using wamp::BasicCoroInvocationUnpacker = typedef SimpleCoroInvocationUnpacker<TSlot, TResult, TArgs...>

Alias to SimpleCoroInvocationUnpacker kept for backward compability.

Deprecated:
Use SimpleCoroInvocationUnpacker instead.

◆ Cancellation

Alias of CallCancellation kept for backward compatiblity.

Deprecated:
Use wamp::CallCancellation instead.

◆ BasicEventUnpacker

template<typename TSlot , typename... TArgs>
using wamp::BasicEventUnpacker = typedef SimpleEventUnpacker<TSlot, TArgs...>

Alias to SimpleEventUnpacker kept for backward compatiblity.

Deprecated:
Use SimpleEventUnpacker instead.

◆ BasicInvocationUnpacker

template<typename TSlot , typename TResult , typename... TArgs>
using wamp::BasicInvocationUnpacker = typedef SimpleInvocationUnpacker<TSlot, TResult, TArgs...>

Alias to SimpleInvocationUnpacker kept for backward compability.

Deprecated:
Use SimpleInvocationUnpacker instead.

◆ CancelMode

Alias to CallCancelMode kept for backward compatibility.

Deprecated:
Use CallCancelMode instead.

Enumeration Type Documentation

◆ SessionErrc

enum wamp::SessionErrc
strong

Error code values used with the SessionCategory error category.

The equivalencies between these codes are as follows:

std::error_code Equivalent condition value
make_error_code(noSuchRealm) joinError
make_error_code(noSuchRole) joinError
make_error_code(systemShutdown) sessionEndedByPeer
make_error_code(closeRealm) sessionEndedByPeer
make_error_code(noSuchSubscription) unsubscribeError
make_error_code(procedureAlreadyExists) registerError
make_error_code(noSuchProcedure) callError
make_error_code(invalidArgument) callError
Enumerator
success 

Operation successful.

sessionEnded 

Operation aborted; session ended by this peer.

sessionEndedByPeer 

Session ended by other peer.

allTransportsFailed 

All transports failed during connection.

joinError 

Join error reported by router.

publishError 

Publish error reported by broker.

subscribeError 

Subscribe error reported by broker.

unsubscribeError 

Unsubscribe error reported by broker.

registerError 

Register error reported by dealer.

unregisterError 

Unregister error reported by dealer.

callError 

Call error reported by callee or dealer.

invalidState 

Invalid state for this operation.

invalidUri 

An invalid WAMP URI was provided.

noSuchProcedure 

No procedure was registered under the given URI.

procedureAlreadyExists 

A procedure with the given URI is already registered.

noSuchRegistration 

Could not unregister; the given registration is not active.

noSuchSubscription 

Could not unsubscribe; the given subscription is not active.

invalidArgument 

The given argument types/values are not acceptable to the called procedure.

systemShutdown 

The other peer is shutting down.

closeRealm 

The other peer is leaving the realm.

goodbyeAndOut 

Session ended successfully.

notAuthorized 

This peer is not authorized to perform the operation.

authorizationFailed 

The authorization operation failed.

noSuchRealm 

Attempt to join non-existent realm.

noSuchRole 

Attempt to authenticate under unsupported role.

cancelled 

A previously issued call was cancelled.

optionNotAllowed 

Option is disallowed by the router.

noEligibleCallee 

Call options lead to the exclusion of all callees providing the procedure.

discloseMeDisallowed 

Router rejected client request to disclose its identity.

networkFailure 

Router encountered a network failure.

◆ DecodingErrc

enum wamp::DecodingErrc
strong

Error code values used with the DecodingCategory error category.

All of the following non-zero codes are equivalent to the DecodingErrc::failure condition:

  • wamp::DecodingErrc
  • jsoncons::json_errc
  • jsoncons::cbor::cbor_errc
  • jsoncons::msgpack::msgpack_errc
Enumerator
success 

Operation succesful.

failure 

Decoding failed.

emptyInput 

Input is empty or has no tokens.

expectedStringKey 

Expected a string key.

badBase64Length 

Invalid Base64 string length.

badBase64Padding 

Invalid Base64 padding.

badBase64Char 

Invalid Base64 character.

◆ ProtocolErrc

enum wamp::ProtocolErrc
strong

Error code values used with the ProtocolCategory error category.

All of the following non-zero codes are equivalent to the ProtocolErrc::badDecode condition:

  • wamp::DecodingErrc
  • jsoncons::json_errc
  • jsoncons::cbor::cbor_errc
  • jsoncons::msgpack::msgpack_errc
Enumerator
success 

Operation successful.

badDecode 

Error decoding WAMP message payload.

badSchema 

Invalid WAMP message schema.

unsupportedMsg 

Received unsupported WAMP message.

unexpectedMsg 

Received unexpected WAMP message.

◆ TransportErrc

enum wamp::TransportErrc
strong

Error code values used with the TransportCategory error category.

Enumerator
success 

Operation successful.

aborted 

Operation aborted.

failed 

Operation failed.

badTxLength 

Outgoing message exceeds maximum length.

badRxLength 

Incoming message exceeds maximum length.

◆ RawsockErrc

enum wamp::RawsockErrc
strong

Error code values used with the RawsockCategory error category.

Enumerator
success 

Operation succesful.

badSerializer 

Serializer unsupported.

badMaxLength 

Maximum message length unacceptable.

reservedBitsUsed 

Use of reserved bits (unsupported feature)

maxConnectionsReached 

Maximum connection count reached.

badHandshake 

Invalid handshake format from peer.

badMessageType 

Invalid message type.

◆ RawsockMaxLength

Enumerators used to specify the maximum length of messages that a raw socket transport can receive.

Enumerator
B_512 

512 bytes

kB_1 

1 kilobyte

kB_2 

2 kilobytes

kB_4 

4 kilobytes

kB_8 

8 kilobytes

kB_16 

16 kilobytes

kB_32 

32 kilobytes

kB_64 

64 kilobytes

kB_128 

128 kilobytes

kB_256 

256 kilobytes

kB_512 

512 kilobytes

MB_1 

1 megabyte

MB_2 

2 megabytes

MB_4 

4 megabytes

MB_8 

8 megabytes

MB_16 

16 megabytes

◆ TypeId

enum wamp::TypeId : uint8_t
strong

Integer ID used to indicate the current dynamic type of a Variant.

Enumerator
null 

For Variant::Null.

boolean 

For Variant::Bool.

integer 

For Variant::Int.

uint 

For Variant::UInt.

real 

For Variant::Real.

string 

For Variant::String.

blob 

For Variant::Blob.

array 

For Variant::Array.

object 

For Variant::Object.

◆ SessionState

enum wamp::SessionState
strong

Enumerates the possible states that a client or router session can be in.

Enumerator
disconnected 

The transport connection is not yet established.

connecting 

Transport connection is in progress.

closed 

Transport connected, but WAMP session is closed.

establishing 

WAMP session establishment is in progress.

authenticating 

WAMP authentication is in progress.

established 

WAMP session is established.

shuttingDown 

WAMP session is closing.

failed 

WAMP session or transport connection has failed.

◆ CallCancelMode

enum wamp::CallCancelMode
strong

Enumerates the possible call cancelling modes.

Enumerator
kill 

INTERRUPT sent to callee; RESULT or ERROR returned, depending on callee.

killNoWait 

INTERRUPT sent to callee; router immediately returns ERROR.

skip 

No INTERRUPT sent to callee; router immediately returns ERROR.

Function Documentation

◆ encode()

template<typename TFormat , typename TOutput >
void wamp::encode ( const Variant variant,
TOutput &&  output 
)

Encodes the given variant to the given byte container or stream.

By design, the output is not cleared before encoding. The encoder is instantiated once and then discarded.

Template Parameters
TFormatThe codec format tag (e.g. Json)
TOutputThe output type (deduced)
See also
wamp::decode
wamp::Encoder

◆ decode()

template<typename TFormat , typename TInput >
std::error_code wamp::decode ( TInput &&  input,
Variant variant 
)

Decodes from the given byte sequence or stream to the given variant.

The decoder is instantiated once and then discarded.

Template Parameters
TFormatThe codec format tag (e.g. Json)
TInputThe input type (deduced)
Returns
a std::error_code indicating success or failure
See also
wamp::encode
wamp::Decoder

◆ basicCoroEvent()

template<typename... TArgs, typename TSlot >
SimpleCoroEventUnpacker< DecayedSlot< TSlot >, TArgs... > wamp::basicCoroEvent ( TSlot &&  slot)
Deprecated:
Use simpleCoroEvent instead.

◆ basicCoroRpc()

template<typename TResult , typename... TArgs, typename TSlot >
SimpleCoroInvocationUnpacker< DecayedSlot< TSlot >, TResult, TArgs... > wamp::basicCoroRpc ( TSlot &&  slot)
Deprecated:
Use simpleCoroRpc instead.

◆ isNumber()

template<typename T >
constexpr bool wamp::isNumber ( )
constexpr

Determines if the given type is considered a number.

Note
To be consitent with Javascript's strict equality, a boolean is not considered a number,

◆ basicEvent()

template<typename... TArgs, typename TSlot >
SimpleEventUnpacker< DecayedSlot< TSlot >, TArgs... > wamp::basicEvent ( TSlot &&  slot)
Deprecated:
Use simpleEvent instead.

◆ basicRpc()

template<typename TResult , typename... TArgs, typename TSlot >
SimpleInvocationUnpacker< DecayedSlot< TSlot >, TResult, TArgs... > wamp::basicRpc ( TSlot &&  slot)
Deprecated:
Use wamp::simpleRpc instead.

◆ convert() [1/15]

template<typename TConverter , typename TValue , DisableIf< std::is_enum< TValue >::value > = 0>
void wamp::convert ( TConverter &  c,
TValue &  val 
)
inline

General function for converting custom types to/from Variant.

You must overload this function for custom types that you want to be convertible to/from Variant. Alternatively, you may also:

Examples
examples/asynctimeclient/main.cpp, examples/asynctimeservice/main.cpp, examples/coro20timeclient/main.cpp, examples/coro20timeservice/main.cpp, examples/futuretimeclient/main.cpp, examples/futuretimeservice/main.cpp, examples/stacklesstimeclient/main.cpp, examples/stacklesstimeservice/main.cpp, examples/timeclient/main.cpp, and examples/timeservice/main.cpp.

◆ lookupWampErrorUri()

bool wamp::lookupWampErrorUri ( const std::string &  uri,
SessionErrc  fallback,
SessionErrc result 
)
related
Returns
'true' if the corresponding error code was found.
Parameters
uriThe URI to search under.
fallbackDefaul value to used if the URI was not found.
[out]result[out] The error code corresponding to the given URI, or the given fallback value if not found

◆ convert() [2/15]

template<typename T , std::size_t Size>
void wamp::convert ( FromVariantConverter conv,
std::array< T, Size > &  array 
)

Performs the conversion from an array variant to a std::array.

Users should not use this function directly. Use Variant::to instead.

◆ convert() [3/15]

template<typename T , std::size_t Size>
void wamp::convert ( ToVariantConverter conv,
std::array< T, Size > &  array 
)

Performs the conversion from a std::array to an array variant.

Users should not use this function directly. Use Variant::from instead.

◆ convert() [4/15]

template<typename T >
void wamp::convert ( FromVariantConverter conv,
boost::optional< T > &  opt 
)

Performs the conversion from a variant to a boost::optional.

Users should not use this function directly. Use Variant::to instead.

◆ convert() [5/15]

template<typename T >
void wamp::convert ( ToVariantConverter conv,
boost::optional< T > &  opt 
)

Performs the conversion from a boost::optional to a variant.

Users should not use this function directly. Use Variant::from instead.

◆ convert() [6/15]

template<typename T >
void wamp::convert ( FromVariantConverter conv,
std::optional< T > &  opt 
)

Performs the conversion from a variant to a std::optional.

Users should not use this function directly. Use Variant::to instead.

◆ convert() [7/15]

template<typename T >
void wamp::convert ( ToVariantConverter conv,
std::optional< T > &  opt 
)

Performs the conversion from a std::optional to a variant.

Users should not use this function directly. Use Variant::from instead.

◆ convert() [8/15]

template<typename T >
void wamp::convert ( FromVariantConverter conv,
std::set< T > &  set 
)

Performs the conversion from an array variant to a std::set.

Users should not use this function directly. Use Variant::to instead.

◆ convert() [9/15]

template<typename T >
void wamp::convert ( ToVariantConverter conv,
std::set< T > &  set 
)

Performs the conversion from a std::set to an array variant.

Users should not use this function directly. Use Variant::from instead.

◆ toTuple()

template<typename... Ts>
void wamp::toTuple ( const wamp::Variant::Array array,
std::tuple< Ts... > &  tuple 
)

Converts a Variant::Array to a std::tuple.

Precondition
The Array's element types must be convertible to the tuple's element types.
Exceptions
error::Conversionif one of the Array element types is not convertible to the target type.

◆ toArray()

template<typename... Ts>
wamp::Variant::Array wamp::toArray ( const std::tuple< Ts... > &  tuple)

Converts a std::tuple to a Variant::Array.

Precondition
The tuple values must be convertible to Variant's bound types (statically checked).

◆ convert() [10/15]

template<typename... Ts>
void wamp::convert ( FromVariantConverter conv,
std::tuple< Ts... > &  tuple 
)

Performs the conversion from an array variant to a std::tuple.

Users should not use this function directly. Use Variant::to instead.

◆ convert() [11/15]

template<typename... Ts>
void wamp::convert ( ToVariantConverter conv,
std::tuple< Ts... > &  tuple 
)

Performs the conversion from a std::tuple to an array variant.

Users should not use this function directly. Use Variant::from instead.

◆ convert() [12/15]

template<typename T >
void wamp::convert ( FromVariantConverter conv,
std::unordered_map< String, T > &  map 
)

Performs the conversion from an object variant to a std::unordered_map.

Users should not use this function directly. Use Variant::to instead.

◆ convert() [13/15]

template<typename T >
void wamp::convert ( ToVariantConverter conv,
std::unordered_map< String, T > &  map 
)

Performs the conversion from a std::unordered_map to an object variant.

Users should not use this function directly. Use Variant::from instead.

◆ convert() [14/15]

template<typename T >
void wamp::convert ( FromVariantConverter conv,
std::unordered_set< T > &  set 
)

Performs the conversion from an array variant to a std::unordered_set.

Users should not use this function directly. Use Variant::to instead.

◆ convert() [15/15]

template<typename T >
void wamp::convert ( ToVariantConverter conv,
std::unordered_set< T > &  set 
)

Performs the conversion from a std::unordered_set to an array variant.

Users should not use this function directly. Use Variant::from instead.