move choice_type to adt folder

This commit is contained in:
Francisco 2020-12-10 17:56:44 +00:00 committed by Andre Puschmann
parent 43082e8d6a
commit b86d2ab7d0
7 changed files with 43 additions and 7 deletions

View File

@ -10,7 +10,7 @@
*
*/
#include "type_utils.h"
#include "srslte/adt/detail/type_utils.h"
#ifndef SRSLTE_CHOICE_TYPE_H
#define SRSLTE_CHOICE_TYPE_H

View File

@ -0,0 +1,34 @@
/**
*
* \section COPYRIGHT
*
* Copyright 2013-2020 Software Radio Systems Limited
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the distribution.
*
*/
#ifndef CPP_TESTS_INDEX_SEQUENCE_H
#define CPP_TESTS_INDEX_SEQUENCE_H
namespace srslte {
template <std::size_t...>
struct index_sequence {};
template <std::size_t N, std::size_t... Next>
struct index_sequence_helper : public index_sequence_helper<N - 1U, N - 1U, Next...> {};
template <std::size_t... Next>
struct index_sequence_helper<0U, Next...> {
using type = index_sequence<Next...>;
};
template <std::size_t N>
using make_index_sequence = typename index_sequence_helper<N>::type;
} // namespace srslte
#endif // CPP_TESTS_INDEX_SEQUENCE_H

View File

@ -287,7 +287,8 @@ const T& get(const TypeContainer& c)
}
template <size_t I,
template <typename...> class TypeContainer,
template <typename...>
class TypeContainer,
typename... Args,
typename T = typename get_index_type<I, Args...>::type>
T& get(TypeContainer<Args...>& c)
@ -296,7 +297,8 @@ T& get(TypeContainer<Args...>& c)
}
template <size_t I,
template <typename...> class TypeContainer,
template <typename...>
class TypeContainer,
typename... Args,
typename T = typename get_index_type<I, Args...>::type>
const T& get(const TypeContainer<Args...>& c)

View File

@ -39,7 +39,7 @@ public:
bool empty() const { return stop_ == start_; }
T length() const { return stop_ - start_; }
auto length() -> decltype(std::declval<T>() - std::declval<T>()) const { return stop_ - start_; }
void set(T start_point, T stop_point)
{

View File

@ -15,9 +15,9 @@
#include "basic_vnf_api.h"
#include "common.h"
#include "srslte/adt/choice_type.h"
#include "srslte/common/block_queue.h"
#include "srslte/common/buffer_pool.h"
#include "srslte/common/choice_type.h"
#include "srslte/common/logmap.h"
#include <arpa/inet.h>
#include <atomic>

View File

@ -13,9 +13,9 @@
#ifndef SRSLTE_FSM_H
#define SRSLTE_FSM_H
#include "srslte/adt/detail/type_utils.h"
#include "srslte/adt/move_callback.h"
#include "srslte/common/logmap.h"
#include "type_utils.h"
#include <cstdio>
#include <limits>
#include <list>

View File

@ -10,7 +10,7 @@
*
*/
#include "srslte/common/choice_type.h"
#include "srslte/adt/choice_type.h"
#include "srslte/common/test_common.h"
struct C {