Skip to content

Commit

Permalink
iox-eclipse-iceoryx#2066 Use 'std::byte' instead of 'iox::byte'
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Nov 18, 2023
1 parent 7c0f2aa commit 66318ff
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
5 changes: 3 additions & 2 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
- Improve process is alive detection [#1361](https://github.com/eclipse-iceoryx/iceoryx/issues/1361)
- only partially
- IPC call is replaced with heartbeat via shared memory
- Replace `iox::byte_t` with std::byte [#1900](https://github.com/eclipse-iceoryx/iceoryx/issues/1900)

**Workflow:**

Expand Down Expand Up @@ -1115,14 +1116,14 @@
iox::access_rights foo { iox::perms::owner_all | iox::perms::group_read };
```

47. Renaming `byte_t` to `byte`
47. Deprecating `byte_t` in favour of `std::byte`

```cpp
// before
iox::byte_t m_size;

// after
iox::byte m_size;
std::byte m_size;
```

48. Move conversion methods from `duration.hpp` to `iceoryx_dust`
Expand Down
5 changes: 3 additions & 2 deletions iceoryx_hoofs/container/include/iox/uninitialized_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "iox/iceoryx_hoofs_types.hpp"

#include <cstddef>
#include <cstdint>

namespace iox
Expand All @@ -37,7 +38,7 @@ struct ZeroedBuffer
// AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation
// AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
byte data[sizeof(ElementType)];
std::byte data[sizeof(ElementType)];
};
// AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation
// AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used
Expand All @@ -57,7 +58,7 @@ struct NonZeroedBuffer
// AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation
// AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
byte data[sizeof(ElementType)];
std::byte data[sizeof(ElementType)];
};
// AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation
// AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "iox/iceoryx_hoofs_types.hpp"
#include "iox/type_traits.hpp"

#include <cstddef>
#include <iostream>
#include <utility>

Expand Down Expand Up @@ -154,7 +155,7 @@ class storable_function<Capacity, signature<ReturnType, Args...>> final

// AXIVION Next Construct AutosarC++19_03-A18.1.1 : safe access is guaranteed since the c-array is wrapped inside the storable_function
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays)
byte m_storage[Capacity]; // storage for the callable
std::byte m_storage[Capacity]; // storage for the callable
void* m_callable{nullptr}; // pointer to stored type-erased callable
ReturnType (*m_invoker)(void*, Args&&...){nullptr}; // indirection to invoke the stored callable,
// nullptr if no callable is stored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ namespace iox
/// namespace IOX_DEPRECATED_SINCE(3, "Please use the 'iox' namespace directly and the corresponding header.")
namespace cxx
{
/// @deprecated use 'iox::byte' instead of 'iox::cxx::byte_t'
using byte_t IOX_DEPRECATED_SINCE(3, "Please use 'iox::byte' instead.") = byte;
/// @deprecated use 'std::byte' instead of 'iox::cxx::byte_t'
using byte_t IOX_DEPRECATED_SINCE(3, "Please use 'std::byte' instead.") = byte;

} // namespace cxx
namespace log
Expand Down
3 changes: 0 additions & 3 deletions iceoryx_hoofs/primitives/include/iox/iceoryx_hoofs_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

namespace iox
{
/// @todo iox-#1900 use std::byte with c++17
using byte = uint8_t;

// AXIVION Next Construct AutosarC++19_03-M2.10.1 : log is a sensible namespace for a logger; furthermore it is in the
// iox namespace and when used as function the compiler will complain
namespace log
Expand Down
3 changes: 2 additions & 1 deletion iceoryx_hoofs/vocabulary/include/iox/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "iox/functional_interface.hpp"
#include "iox/iceoryx_hoofs_types.hpp"

#include <cstddef>
#include <new> // needed for placement new in the construct_value member function
#include <utility>

Expand Down Expand Up @@ -237,7 +238,7 @@ class optional final : public FunctionalInterface<optional<T>, T, void>
// AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation
// AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used
// NOLINTNEXTLINE(hicpp-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays)
byte data[sizeof(T)];
std::byte data[sizeof(T)];
};
// AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation
element_t m_data;
Expand Down
3 changes: 2 additions & 1 deletion iceoryx_hoofs/vocabulary/include/iox/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "iox/detail/variant_internal.hpp"
#include "iox/iceoryx_hoofs_types.hpp"

#include <cstddef>
#include <cstdint>
#include <iostream>
#include <limits>
Expand Down Expand Up @@ -286,7 +287,7 @@ class variant final
// AXIVION Next Construct AutosarC++19_03-M0.1.3 : data provides the actual storage and is accessed via m_storage since &m_storage.data = &m_storage
// AXIVION Next Construct AutosarC++19_03-A18.1.1 : safe access is guaranteed since the c-array is wrapped inside the variant class
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays)
iox::byte data[TYPE_SIZE];
std::byte data[TYPE_SIZE];
};
storage_t m_storage{};
uint64_t m_type_index{INVALID_VARIANT_INDEX};
Expand Down

0 comments on commit 66318ff

Please sign in to comment.