azure-core-amqp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Azure::Core::Amqp::Models::AmqpValue Class Referencefinal

#include <amqp_value.hpp>

Public Member Functions

 AmqpValue () noexcept
 Construct an AMQP null (empty) value.
 
 AmqpValue (AmqpValue const &that) noexcept
 Construct an AMQP Value from an existing AMQP Value.
 
 AmqpValue (AmqpValue &&that) noexcept
 Move an AMQP Value to another existing AMQP Value.
 
AmqpValueoperator= (AmqpValue const &that)
 Copy an AMQP value to the current AMQP value.
 
AmqpValueoperator= (AmqpValue &&that) noexcept
 Move an AMQP value to the current AMQP value.
 
 AmqpValue (bool value)
 Construct an AMQP boolean value.
 
 AmqpValue (std::uint8_t value)
 Construct an AMQP ubyte value, an 8 bit unsigned integer.
 
 AmqpValue (std::uint16_t value)
 Construct an AMQP ushort value.
 
 AmqpValue (std::uint32_t value)
 Construct an AMQP uint value.
 
 AmqpValue (std::uint64_t value)
 Construct an AMQP ulong value, a 64bit unsigned integer.
 
 AmqpValue (std::int8_t value)
 Construct an AMQP byte value, an 8 bit signed integer.
 
 AmqpValue (char value)
 Construct an AMQP byte value, an 8 bit signed integer.
 
 AmqpValue (std::int16_t value)
 Construct an AMQP short value, a 16 bit signed integer.
 
 AmqpValue (std::int32_t value)
 Construct an AMQP int value, a 32 bit signed integer.
 
 AmqpValue (std::int64_t value)
 Construct an AMQP long value, a 64 bit signed integer.
 
 AmqpValue (float value)
 Construct an AMQP float value, an IEEE 754-2008 value.
 
 AmqpValue (double value)
 Construct an AMQP double value, an IEEE 754-2008 value.
 
 AmqpValue (std::string const &value)
 Construct an AMQP string value, a UTF-8 encoded sequence of characters.
 
 AmqpValue (const char *value)
 Construct an AMQP string value, a UTF-8 encoded sequence of characters.
 
 AmqpValue (char32_t value)
 Construct an AMQP Char value, a UTF-32BE encoded Unicode character.
 
 AmqpValue (Azure::Core::Uuid const &value)
 Construct an AMQP Uuid value, an RFC-4122 Universally Unique Identifier.
 
bool operator== (AmqpValue const &that) const
 Equality comparison operator.
 
bool operator!= (AmqpValue const &that) const
 Equality comparison operator.
 
bool operator< (AmqpValue const &that) const
 Less Than comparison operator.
 
AmqpValueType GetType () const
 Returns the underlying type of the AMQP value.
 
bool IsNull () const
 Returns 'true' if the AMQP value is "null".
 
 operator bool () const
 convert the current AMQP Value to a boolean.
 
 operator std::uint8_t () const
 convert the current AMQP Value to an unsigned 8 bit integer.
 
 operator std::int8_t () const
 convert the current AMQP Value to a signed 8 bit integer.
 
 operator char () const
 convert the current AMQP Value to a signed 8 bit integer. Convenience function to allow an AmqpValue to be constructed from a 'char' value.
 
 operator std::uint16_t () const
 convert the current AMQP Value to an unsigned 16 bit integer.
 
 operator std::int16_t () const
 convert the current AMQP Value to a signed 16 bit integer.
 
 operator std::uint32_t () const
 convert the current AMQP Value to an unsigned 32 bit integer.
 
 operator std::int32_t () const
 convert the current AMQP Value to a signed 32 bit integer.
 
 operator std::uint64_t () const
 convert the current AMQP Value to an unsigned 64 bit integer.
 
 operator std::int64_t () const
 convert the current AMQP Value to a signed 64 bit integer.
 
 operator float () const
 convert the current AMQP Value to a 32 bit IEEE 'float' value..
 
 operator double () const
 convert the current AMQP Value to a 64 bit IEEE 'double' value.
 
 operator char32_t () const
 convert the current AMQP Value to a 32bit UCS32 value.
 
 operator std::string () const
 convert the current AMQP Value to a string.
 
 operator Azure::Core::Uuid () const
 convert the current AMQP Value to a UUID.
 
AmqpList AsList () const
 convert the current AMQP Value to an AmqpList.
 
AmqpMap AsMap () const
 convert the current AMQP Value to an AmqpMap.
 
AmqpArray AsArray () const
 convert the current AMQP Value to an AmqpArray.
 
AmqpBinaryData AsBinary () const
 convert the current AMQP Value to an AmqpBinaryData.
 
AmqpTimestamp AsTimestamp () const
 convert the current AMQP Value to an AmqpTimestamp.
 
AmqpSymbol AsSymbol () const
 convert the current AMQP Value to an AmqpSymbol.
 
AmqpComposite AsComposite () const
 convert the current AMQP Value to an AMQP Composite value.
 
AmqpDescribed AsDescribed () const
 convert the current AMQP Value to an AMQP Described value.
 

Static Public Member Functions

static std::vector< uint8_tSerialize (AmqpValue const &value)
 Serialize this AMQP value as an array of bytes.
 
static size_t GetSerializedSize (AmqpValue const &value)
 Returns the size (in bytes) of the serialized form of this value.
 
static AmqpValue Deserialize (uint8_t const *data, size_t size)
 Deserialize an AMQP value from an array of bytes.
 

Detailed Description

An AMQP value.

An AMQP value is a polymorphic type that can be used to represent any AMQP type.

See also
https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html

Constructor & Destructor Documentation

◆ AmqpValue() [1/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( )
noexcept

◆ AmqpValue() [2/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( AmqpValue const &  that)
noexcept
Parameters
that- source value to copy.

◆ AmqpValue() [3/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( AmqpValue &&  that)
noexcept
Parameters
that- source value to move.

◆ AmqpValue() [4/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( bool  value)

Defined in AMQP Core Types section 1.6.2.

Parameters
valuevalue to be set.

◆ AmqpValue() [5/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( std::uint8_t  value)

Defined in AMQP Core Types section 1.6.3.

Parameters
valuevalue to be set.

◆ AmqpValue() [6/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( std::uint16_t  value)

Defined in AMQP Core Types section 1.6.4.

Parameters
valuevalue to be set.

◆ AmqpValue() [7/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( std::uint32_t  value)

Defined in AMQP Core Types section 1.6.5.

Parameters
valuevalue to be set.

◆ AmqpValue() [8/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( std::uint64_t  value)

Defined in AMQP Core Types section 1.6.6.

Parameters
valuevalue to be set.

◆ AmqpValue() [9/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( std::int8_t  value)

Defined in AMQP Core Types section 1.6.7.

Parameters
valuevalue to be set.

◆ AmqpValue() [10/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( char  value)

Defined in AMQP Core Types section 1.6.7.

Parameters
valuevalue to be set.
Remarks
This field is a convenience overload to allow clients to declare an AmqpValue with a C++ character.

◆ AmqpValue() [11/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( std::int16_t  value)

Defined in AMQP Core Types section 1.6.8.

Parameters
valuevalue to be set.

◆ AmqpValue() [12/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( std::int32_t  value)

Defined in AMQP Core Types section 1.6.9.

Parameters
valuevalue to be set.

◆ AmqpValue() [13/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( std::int64_t  value)

Defined in AMQP Core Types section 1.6.10.

Parameters
valuevalue to be set.

◆ AmqpValue() [14/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( float  value)

Defined in AMQP Core Types section 1.6.11.

Parameters
valuevalue to be set.

◆ AmqpValue() [15/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( double  value)

Defined in AMQP Core Types section 1.6.12.

Parameters
valuevalue to be set.

◆ AmqpValue() [16/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( std::string const &  value)
explicit

Defined in AMQP Core Types section 1.6.20.

Parameters
valueto be set.

◆ AmqpValue() [17/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( const char *  value)

Defined in AMQP Core Types section 1.6.20.

Parameters
valueto be set.
Remarks
This is a convenience constructor to allow callers to specify:
AmqpValue myValue("This is some text");
Definition amqp_value.hpp:104

◆ AmqpValue() [18/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( char32_t  value)

Defined in AMQP Core Types section 1.6.16.

Parameters
valueUTF-32 encoded unicode value to be set.

◆ AmqpValue() [19/19]

Azure::Core::Amqp::Models::AmqpValue::AmqpValue ( Azure::Core::Uuid const &  value)

TODO: Decimal32, Decimal64, and Decimal128.

Defined in AMQP Core Types section 1.6.18.

Parameters
valueUTF-32 encoded unicode value to be set.

Member Function Documentation

◆ AsArray()

AmqpArray Azure::Core::Amqp::Models::AmqpValue::AsArray ( ) const
Returns
the value as an AmqpArray.
Exceptions
std::runtime_errorif the underlying AMQP value is not an array.

◆ AsBinary()

AmqpBinaryData Azure::Core::Amqp::Models::AmqpValue::AsBinary ( ) const
Returns
the value as an AmqpBinaryData.
Exceptions
std::runtime_errorif the underlying AMQP value is not a binary data.

◆ AsComposite()

AmqpComposite Azure::Core::Amqp::Models::AmqpValue::AsComposite ( ) const

An AMQP Composite value is functionally a list with a defined structure. The structure definition can be found via the GetDescriptor method.

Returns
the value as an AmqpComposite.
Exceptions
std::runtime_errorif the underlying AMQP value is not a Composite value.

◆ AsDescribed()

AmqpDescribed Azure::Core::Amqp::Models::AmqpValue::AsDescribed ( ) const

An AMQP Described value is a tuple consisting of a Descriptor and Value.

Returns
the value as an AmqpDescribed.
Exceptions
std::runtime_errorif the underlying AMQP value is not a Described value.

◆ AsList()

AmqpList Azure::Core::Amqp::Models::AmqpValue::AsList ( ) const
Returns
the value as an AmqpList.
Exceptions
std::runtime_errorif the underlying AMQP value is not a list.

◆ AsMap()

AmqpMap Azure::Core::Amqp::Models::AmqpValue::AsMap ( ) const
Returns
the value as an AmqpMap.
Exceptions
std::runtime_errorif the underlying AMQP value is not a map.

◆ AsSymbol()

AmqpSymbol Azure::Core::Amqp::Models::AmqpValue::AsSymbol ( ) const
Returns
the value as an AmqpSymbol.
Exceptions
std::runtime_errorif the underlying AMQP value is not a symbol.

◆ AsTimestamp()

AmqpTimestamp Azure::Core::Amqp::Models::AmqpValue::AsTimestamp ( ) const
Returns
the value as an AmqpTimestamp.
Exceptions
std::runtime_errorif the underlying AMQP value is not a timestamp.

◆ Deserialize()

AmqpValue Azure::Core::Amqp::Models::AmqpValue::Deserialize ( uint8_t const *  data,
size_t  size 
)
static
Parameters
[in]dataThe serialized form of the AMQP value to deserialize.
[in]sizeThe size of the data parameter to deserialize.

◆ GetType()

AmqpValueType Azure::Core::Amqp::Models::AmqpValue::GetType ( ) const
Returns
AmqpValueType of the AMQP value.

◆ IsNull()

bool Azure::Core::Amqp::Models::AmqpValue::IsNull ( ) const
Returns
true if the AmqpValue is null.

◆ operator Azure::Core::Uuid()

Azure::Core::Amqp::Models::AmqpValue::operator Azure::Core::Uuid ( ) const
Returns
the value as an Azure::Core::Uuid value.
Exceptions
std::runtime_errorif the underlying AMQP value is not a UUID.

◆ operator bool()

Azure::Core::Amqp::Models::AmqpValue::operator bool ( ) const
Returns
bool true if the AMQP value is true.
Exceptions
std::runtime_errorif the underlying AMQP value is not a boolean.

◆ operator char()

Azure::Core::Amqp::Models::AmqpValue::operator char ( ) const
Returns
the value as a char.
Exceptions
std::runtime_errorif the underlying AMQP value is not a signed 8 bit integer.

◆ operator char32_t()

Azure::Core::Amqp::Models::AmqpValue::operator char32_t ( ) const
Returns
the value as a 32 bit character.
Exceptions
std::runtime_errorif the underlying AMQP value is not a 32 bit character.

◆ operator double()

Azure::Core::Amqp::Models::AmqpValue::operator double ( ) const
Returns
the value as a double.
Exceptions
std::runtime_errorif the underlying AMQP value is not a double.

◆ operator float()

Azure::Core::Amqp::Models::AmqpValue::operator float ( ) const
Returns
the value as a float.
Exceptions
std::runtime_errorif the underlying AMQP value is not a float.

◆ operator std::int16_t()

Azure::Core::Amqp::Models::AmqpValue::operator std::int16_t ( ) const
Returns
the value as a signed 16 bit integer.
Exceptions
std::runtime_errorif the underlying AMQP value is not a signed 16 bit integer.

◆ operator std::int32_t()

Azure::Core::Amqp::Models::AmqpValue::operator std::int32_t ( ) const
Returns
the value as a signed 32 bit integer.
Exceptions
std::runtime_errorif the underlying AMQP value is not a signed 32 bit integer.

◆ operator std::int64_t()

Azure::Core::Amqp::Models::AmqpValue::operator std::int64_t ( ) const
Returns
the value as a signed 64 bit integer.
Exceptions
std::runtime_errorif the underlying AMQP value is not a signed 64 bit integer.

◆ operator std::int8_t()

Azure::Core::Amqp::Models::AmqpValue::operator std::int8_t ( ) const
Returns
the value as an 8 bit integer.
Exceptions
std::runtime_errorif the underlying AMQP value is not a signed 8 bit integer.

◆ operator std::string()

Azure::Core::Amqp::Models::AmqpValue::operator std::string ( ) const
explicit
Returns
the value as a string.
Exceptions
std::runtime_errorif the underlying AMQP value is not a string.

◆ operator std::uint16_t()

Azure::Core::Amqp::Models::AmqpValue::operator std::uint16_t ( ) const
Returns
the value as an unsigned 16 bit integer.
Exceptions
std::runtime_errorif the underlying AMQP value is not an unsigned 16 bit integer.

◆ operator std::uint32_t()

Azure::Core::Amqp::Models::AmqpValue::operator std::uint32_t ( ) const
Returns
the value as an unsigned 32 bit integer.
Exceptions
std::runtime_errorif the underlying AMQP value is not an unsigned 32 bit integer.

◆ operator std::uint64_t()

Azure::Core::Amqp::Models::AmqpValue::operator std::uint64_t ( ) const
Returns
the value as an unsigned 64 bit integer.
Exceptions
std::runtime_errorif the underlying AMQP value is not an unsigned 64 bit integer.

◆ operator std::uint8_t()

Azure::Core::Amqp::Models::AmqpValue::operator std::uint8_t ( ) const
Returns
the value as an unsigned 8 bit integer.
Exceptions
std::runtime_errorif the underlying AMQP value is not an unsigned 8 bit integer.

◆ operator!=()

bool Azure::Core::Amqp::Models::AmqpValue::operator!= ( AmqpValue const &  that) const
inline
Parameters
that- Value to compare to this value.
Returns
true if the that is equal to this.

◆ operator<()

bool Azure::Core::Amqp::Models::AmqpValue::operator< ( AmqpValue const &  that) const
Parameters
that- Value to compare to this value.
Returns
true if the that is less than this.
Remarks
When comparing AMQP values, if the two values are not the same type, this returns if the numeric value of this.GetType() is less than that.GetType(). If the two values are of the same type, this returns if the value of this is less than the value of that.

◆ operator=() [1/2]

AmqpValue & Azure::Core::Amqp::Models::AmqpValue::operator= ( AmqpValue &&  that)
noexcept
Parameters
thatthe other AMQP Value to move.
Returns
"this".

◆ operator=() [2/2]

AmqpValue & Azure::Core::Amqp::Models::AmqpValue::operator= ( AmqpValue const &  that)
Parameters
thatthe other AMQP Value to copy.
Returns
"this".

◆ operator==()

bool Azure::Core::Amqp::Models::AmqpValue::operator== ( AmqpValue const &  that) const
Parameters
that- Value to compare to this value.
Returns
true if the that is equal to this.

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