Commit 4f8609bd authored by Dominik Charousset's avatar Dominik Charousset

Add convenience aliases for byte spans

parent b3d2394e
...@@ -8,6 +8,8 @@ is based on [Keep a Changelog](https://keepachangelog.com). ...@@ -8,6 +8,8 @@ is based on [Keep a Changelog](https://keepachangelog.com).
### Added ### Added
- The enum `caf::sec` received an additional error code: `connection_closed`. - The enum `caf::sec` received an additional error code: `connection_closed`.
- The new `byte_span` and `const_byte_span` aliases provide convenient
definitions when working with sequences of bytes.
### Changed ### Changed
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "caf/binary_serializer.hpp" #include "caf/binary_serializer.hpp"
#include "caf/blocking_actor.hpp" #include "caf/blocking_actor.hpp"
#include "caf/byte_buffer.hpp" #include "caf/byte_buffer.hpp"
#include "caf/byte_span.hpp"
#include "caf/config_option.hpp" #include "caf/config_option.hpp"
#include "caf/config_option_adder.hpp" #include "caf/config_option_adder.hpp"
#include "caf/config_value.hpp" #include "caf/config_value.hpp"
......
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2020 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#pragma once
#include "caf/byte.hpp"
#include "caf/span.hpp"
namespace caf {
/// Convenience alias for referring to a writable sequence of bytes.
using byte_span = span<byte>;
/// Convenience alias for referring to a read-only sequence of bytes.
using const_byte_span = span<const byte>;
} // namespace caf
...@@ -202,6 +202,8 @@ enum class stream_priority; ...@@ -202,6 +202,8 @@ enum class stream_priority;
using actor_id = uint64_t; using actor_id = uint64_t;
using byte_buffer = std::vector<byte>; using byte_buffer = std::vector<byte>;
using byte_span = span<byte>;
using const_byte_span = span<const byte>;
using ip_address = ipv6_address; using ip_address = ipv6_address;
using ip_endpoint = ipv6_endpoint; using ip_endpoint = ipv6_endpoint;
using ip_subnet = ipv6_subnet; using ip_subnet = ipv6_subnet;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment