- #pragma once
-
- #include <cppamqp/types.h>
-
- namespace cppamqp
- {
-
- template<>
- inline void field_value::set<bool>(bool&& value)
- {
- this->kind = AMQP_FIELD_KIND_BOOLEAN;
- this->value.boolean = static_cast<int>(value);
- }
-
- template<>
- inline void field_value::set<int8_t>(int8_t&& value)
- {
- this->kind = AMQP_FIELD_KIND_I8;
- this->value.i8 = value;
- }
-
- template<>
- inline void field_value::set<uint8_t>(uint8_t&& value)
- {
- this->kind = AMQP_FIELD_KIND_U8;
- this->value.u8 = value;
- }
-
- template<>
- inline void field_value::set<int16_t>(int16_t&& value)
- {
- this->kind = AMQP_FIELD_KIND_I16;
- this->value.i16 = value;
- }
-
- template<>
- inline void field_value::set<uint16_t>(uint16_t&& value)
- {
- this->kind = AMQP_FIELD_KIND_U16;
- this->value.u16 = value;
- }
-
- template<>
- inline void field_value::set<int32_t>(int32_t&& value)
- {
- this->kind = AMQP_FIELD_KIND_I32;
- this->value.i32 = value;
- }
-
- template<>
- inline void field_value::set<uint32_t>(uint32_t&& value)
- {
- this->kind = AMQP_FIELD_KIND_U32;
- this->value.u32 = value;
- }
-
- template<>
- inline void field_value::set<int64_t>(int64_t&& value)
- {
- this->kind = AMQP_FIELD_KIND_I64;
- this->value.i64 = value;
- }
-
- template<>
- inline void field_value::set<uint64_t>(uint64_t&& value)
- {
- this->kind = AMQP_FIELD_KIND_U64;
- this->value.u64 = value;
- }
-
- template<>
- inline void field_value::set<float>(float&& value)
- {
- this->kind = AMQP_FIELD_KIND_F32;
- this->value.f32 = value;
- }
-
- template<>
- inline void field_value::set<double>(double&& value)
- {
- this->kind = AMQP_FIELD_KIND_F64;
- this->value.f64 = value;
- }
-
-
- field_value::field_value()
- {
- this->kind = AMQP_FIELD_KIND_VOID;
- }
-
- template<typename T_value>
- field_value::field_value(T_value&& value)
- { set(std::forward<T_value>(value)); }
-
- template<typename T_value>
- field_value& field_value::operator=(T_value&& value)
- {
- set(std::forward<T_value>(value));
- return *this;
- }
-
- inline const amqp_field_value_t& field_value::get() const
- { return *this; }
-
- }
|