Loading...
Searching...
No Matches
node.hpp
/* Copyright (c) 2018-2023 Marcelo Zimbres Silva (mzimbres@gmail.com)
*
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE.txt)
*/
#ifndef BOOST_REDIS_RESP3_NODE_HPP
#define BOOST_REDIS_RESP3_NODE_HPP
#include <boost/redis/resp3/type.hpp>
namespace boost::redis::resp3 {
template <class String>
struct basic_node {
type data_type = type::invalid;
std::size_t aggregate_size{};
std::size_t depth{};
String value{};
};
template <class String>
auto operator==(basic_node<String> const& a, basic_node<String> const& b)
{
return a.aggregate_size == b.aggregate_size
&& a.depth == b.depth
&& a.data_type == b.data_type
&& a.value == b.value;
};
using node = basic_node<std::string>;
} // boost::redis::resp3
#endif // BOOST_REDIS_RESP3_NODE_HPP
boost::redis::resp3::type
type
RESP3 data types.
Definition: type.hpp:23
boost::redis::resp3::type::invalid
@ invalid
Invalid.
boost::redis::resp3::basic_node
A node in the response tree.
Definition: node.hpp:28
boost::redis::resp3::basic_node::depth
std::size_t depth
The depth of this node in the response tree.
Definition: node.hpp:36
boost::redis::resp3::basic_node::aggregate_size
std::size_t aggregate_size
The number of elements of an aggregate.
Definition: node.hpp:33
boost::redis::resp3::basic_node::data_type
type data_type
The RESP3 type of the data in this node.
Definition: node.hpp:30
boost::redis::resp3::basic_node::value
String value
The actual data. For aggregate types this is usually empty.
Definition: node.hpp:39
boost::redis::resp3::basic_node::operator==
auto operator==(basic_node< String > const &a, basic_node< String > const &b)
Compares a node for equality.
Definition: node.hpp:49