32 static bool equals(
const std::vector<char>& a1,
const std::vector<char>& a2)
34 if (a1.size() != a2.size()) {
38 for (
auto i1 = a1.begin(), i2 = a2.begin(); i1 != a1.end();
47 static bool equals(
const std::vector<uint8_t>& a1,
const std::vector<uint8_t>& a2)
49 if (a1.size() != a2.size()) {
53 for (
auto i1 = a1.begin(), i2 = a2.begin(); i1 != a1.end();
66 for (
auto i = a.begin(); i != a.end(); i++)
72 static int hashCode(
const std::vector<uint8_t> a)
76 for (
auto i = a.begin(); i != a.end(); i++)
82 static std::vector<char>
copyOfRange(
const std::vector<char>& original,
86 if ((to - from) > original.size()) {
90 std::vector<char> vec;
91 std::copy(original.begin() + from, original.begin() + to, std::back_inserter(vec));
96 static std::vector<uint8_t>
copyOfRange(
const std::vector<uint8_t>& original,
100 if ((to - from) > original.size()) {
104 std::vector<uint8_t> vec;
105 std::copy(original.begin() + from, original.begin() + to, std::back_inserter(vec));
110 template <
typename T>
111 static bool contains(
const std::vector<T>& a,
const T b)
113 for (
const auto& v : a) {
122 template <
typename T>
125 std::sort(a.begin(), a.end());
126 std::sort(b.begin(), b.end());
128 return std::includes(a.begin(), a.end(), b.begin(), b.end());
131 template <
typename T>
134 for (
const auto& v : a) {
143 template <
typename T>
144 static int indexOf(
const std::vector<T>& a,
const T b)
146 auto it = std::find(a.begin(), a.end(), b);
148 return static_cast<int>(it - a.begin());
154 template <
typename T>
155 static bool addAll(std::vector<T>& a,
const std::vector<T>& b)
161 for (
const auto& t : b) {
168 template <
typename T>
169 static bool addAll(std::vector<std::shared_ptr<T>>& a,
const std::vector<std::shared_ptr<T>>& b)
175 for (
const auto& t : b) {
183 template <
typename T,
typename U>
184 static bool addAll(std::vector<std::shared_ptr<T>>& a,
const std::vector<std::shared_ptr<U>>& b)
190 for (
const auto& u : b) {
191 a.push_back(std::dynamic_pointer_cast<T>(u));
197 template <
typename T>
198 static void remove(std::vector<std::shared_ptr<T>>& a,
const std::shared_ptr<T>& b)
200 const auto it = std::find(a.begin(), a.end(), b);
207 template <
typename T,
typename U>
208 static bool removeAll(std::vector<std::shared_ptr<T>>& a,
const std::vector<std::shared_ptr<U>>& b)
216 for (
const auto& u : b) {
217 const auto t = std::dynamic_pointer_cast<T>(u);
218 const auto it = std::find(a.begin(), a.end(), t);
229 template <
typename T>
230 static void fill(std::vector<T>& a,
const size_t from_Index,
const size_t to_Index, T val)
232 for (
size_t i = from_Index; i < to_Index; i++) {
static bool addAll(std::vector< T > &a, const std::vector< T > &b)
static bool addAll(std::vector< std::shared_ptr< T > > &a, const std::vector< std::shared_ptr< U > > &b)
static void remove(std::vector< std::shared_ptr< T > > &a, const std::shared_ptr< T > &b)
static bool containsOnly(const std::vector< T > &a, const T b)
static void fill(std::vector< T > &a, const size_t from_Index, const size_t to_Index, T val)
static bool contains(const std::vector< T > &a, const T b)
static int hashCode(const std::vector< char > a)
static bool removeAll(std::vector< std::shared_ptr< T > > &a, const std::vector< std::shared_ptr< U > > &b)
static bool addAll(std::vector< std::shared_ptr< T > > &a, const std::vector< std::shared_ptr< T > > &b)
static int indexOf(const std::vector< T > &a, const T b)
static bool equals(const std::vector< uint8_t > &a1, const std::vector< uint8_t > &a2)
static bool equals(const std::vector< char > &a1, const std::vector< char > &a2)
static bool containsAll(std::vector< T > a, std::vector< T > b)
static int hashCode(const std::vector< uint8_t > a)
static std::vector< uint8_t > copyOfRange(const std::vector< uint8_t > &original, const size_t from, const size_t to)
static std::vector< char > copyOfRange(const std::vector< char > &original, const size_t from, const size_t to)