7#include "sparta/utils/Utils.hpp"
15template<
typename T>
struct is_vector :
public std::false_type {};
16template<
typename T,
typename A>
17 struct is_vector<std::vector<T, A>> :
public std::true_type {};
23template <
template<
class,
class...>
class C,
typename T>
27 typedef C<T> container_t;
29 const std::vector<container_t>& input_;
35 void deepCopy(std::vector<container_t>& output)
const
37 for (
const auto& el : input_){
42 void extractRawCopy(std::vector<T*>& output)
const
44 for (
const container_t& el : input_){
45 output.push_back(el.get());
58 typedef std::unique_ptr<VT> container_t;
59 const std::vector<container_t>& input_;
65 void deepCopy(std::vector<container_t>& output)
const
67 for(
const container_t& el : input_){
68 if(el.get() !=
nullptr){
69 output.emplace_back(
new VT(*el.get()));
71 output.emplace_back(
nullptr);
76 void extractRawCopy(std::vector<VT*>& output)
const
78 for (
const container_t& el : input_){
79 output.push_back(el.get());
92 typedef std::shared_ptr<VT> container_t;
93 const std::vector<container_t>& input_;
99 void deepCopy(std::vector<container_t>& output)
const
101 for(
const container_t& el : input_){
102 if(el.get() !=
nullptr){
103 output.emplace_back(
new VT(*el.get()));
105 output.emplace_back(
nullptr);
110 void extractRawCopy(std::vector<VT*>& output)
const
112 for (
const container_t& el : input_){
113 output.push_back(el.get());
124template <
template<
class,
class...>
class C,
typename T>
125void copyVectorDeep(
const std::vector<C<T>>& input,
126 std::vector<C<T>>& output)
137template <
template<
class,
class...>
class C,
typename T>
138void copyVectorExtractRawPointers(
const std::vector<C<T>>& input,
139 std::vector<T*>& output)
141 VectorCopier<C,T>(input).extractRawCopy(output);
Set of macros for Sparta assertions. Caught by the framework.
Exception class for all of Sparta.
Utility for element-wise potentially-deep-copying a vector. Invoked by methods at the end of this fil...
Macros for handling exponential backoff.