forked from eclipse-iceoryx/iceoryx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iox-eclipse-iceoryx#391 cleanup and restructuring of storable_function
Signed-off-by: Matthias Killat <matthias.killat@apex.ai>
- Loading branch information
1 parent
b88e1fa
commit f680efa
Showing
5 changed files
with
459 additions
and
340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) 2020 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef IOX_UTILS_FUNCTION_HPP | ||
#define IOX_UTILS_FUNCTION_HPP | ||
|
||
#include "iceoryx_utils/internal/cxx/static_storage.hpp" | ||
#include "iceoryx_utils/internal/cxx/storable_function.hpp" | ||
|
||
namespace iox | ||
{ | ||
namespace cxx | ||
{ | ||
/// @note set the storage type and reorder template arguments for the user API | ||
/// the storage type must precede the (required) variadic arguments in the internal one | ||
/// if the static storage is insufficient to store the callable we get a compile time error | ||
|
||
/// @note this alias is needed to improve usability | ||
/// for the API see storable_function | ||
template <typename Signature, uint64_t Bytes = 128> | ||
using function = storable_function<static_storage<Bytes>, Signature>; | ||
|
||
/// @note the following would essentially be a complete std::function replacement | ||
/// which would allocate dynamically if the static storages of Bytes is not sufficient | ||
/// to store the callable (i.e. we use an optimized_storage) | ||
// template <typename Signature, uint64_t Bytes = 128> | ||
// using function = detail::storable_function<optimized_storage<Bytes>, Signature>; | ||
// or alternatively | ||
// template <typename Signature> | ||
// using function = detail::storable_function<dynamic_storage, Signature>; | ||
|
||
} // namespace cxx | ||
} // namespace iox | ||
|
||
#endif // IOX_UTILS_FUNCTION_HPP |
339 changes: 0 additions & 339 deletions
339
iceoryx_utils/include/iceoryx_utils/internal/cxx/function.hpp
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.