OpenKalman
get_pattern_collection.hpp
Go to the documentation of this file.
1 /* This file is part of OpenKalman, a header-only C++ library for
2  * Kalman filters and other recursive filters.
3  *
4  * Copyright (c) 2022-2026 Christopher Lee Ogden <ogden@gatech.edu>
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
9  */
10 
16 #ifndef OPENKALMAN_GET_PATTERN_COLLECTION_HPP
17 #define OPENKALMAN_GET_PATTERN_COLLECTION_HPP
18 
19 #include "patterns/patterns.hpp"
23 
24 namespace OpenKalman
25 {
29 #ifdef __cpp_concepts
30  template<indexible T>
31  constexpr patterns::pattern_collection decltype(auto)
32 #else
33  template<typename T, std::enable_if_t<indexible<T>, int> = 0>
34  constexpr decltype(auto)
35 #endif
37  {
38  using Td = stdex::remove_cvref_t<T>;
39  if constexpr (interface::get_pattern_collection_defined_for<Td>)
40  {
41  return stdex::invoke(interface::object_traits<Td>::get_pattern_collection, std::forward<T>(t));
42  }
43  else
44  {
45  auto ex = get_mdspan(t).extents();
46  return ex;
47  }
48  }
49 
50 }
51 
52 #endif
constexpr bool pattern_collection
An object describing a sized collection of /ref sized_pattern objects.
Definition: pattern_collection.hpp:66
decltype(auto) constexpr get_pattern_collection(T &&t)
Get the patterns::pattern_collection associated with indexible object T.
Definition: get_pattern_collection.hpp:36
The root namespace for OpenKalman.
Definition: basics.hpp:34
Definition: object_traits.hpp:38
Definition of get_mdspan function.
Definition for index_count.
Concepts for testing whether object_traits or library_interface definitions exist for a particular ob...
decltype(auto) constexpr get_mdspan(T &&t)
Get the mdspan associated with indexible object T.
Definition: get_mdspan.hpp:35