mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
less public headers
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "TypeTraits.h"
|
||||
#include "ToString.h"
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
@ -47,28 +48,6 @@ template <typename T, size_t Capacity> class StaticVector {
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Compare StaticVector with any other container*/
|
||||
// template <typename V>
|
||||
// typename std::enable_if<is_container<V>::value, bool>::type
|
||||
// operator==(const V &other) const noexcept {
|
||||
// if (current_size != other.size()) {
|
||||
// return false;
|
||||
// } else {
|
||||
// for (size_t i = 0; i != current_size; ++i) {
|
||||
// if (data_[i] != other[i]) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// template <typename V>
|
||||
// typename std::enable_if<is_container<V>::value, bool>::type
|
||||
// operator!=(const V &other) const noexcept {
|
||||
// return !(*this == other);
|
||||
// }
|
||||
|
||||
operator std::vector<T>() { return std::vector<T>(begin(), end()); }
|
||||
|
||||
T &operator[](size_t i) { return data_[i]; }
|
||||
@ -204,20 +183,13 @@ bool operator!=(const std::vector<T> &lhs,
|
||||
return !rhs.is_equal(lhs);
|
||||
}
|
||||
|
||||
/** support flipped order compare */
|
||||
// template <typename T, size_t Capacity, typename C>
|
||||
// typename std::enable_if<is_container<C>::value, bool>::type operator==(
|
||||
// const C &container,
|
||||
// const StaticVector<T, Capacity> &fixed_container) noexcept {
|
||||
// return fixed_container.operator==(container);
|
||||
// }
|
||||
template <typename T, size_t Capacity>
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const sls::StaticVector<T, Capacity> &c) {
|
||||
return os << ToString(c);
|
||||
}
|
||||
|
||||
// /** support flipped order compare */
|
||||
// template <typename T, size_t Capacity, typename C>
|
||||
// typename std::enable_if<is_container<C>::value, bool>::type operator!=(
|
||||
// const C &container,
|
||||
// const StaticVector<T, Capacity> &fixed_container) noexcept {
|
||||
// return fixed_container.operator!=(container);
|
||||
// }
|
||||
|
||||
} // namespace sls
|
||||
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "StaticVector.h"
|
||||
#include "TimeHelper.h"
|
||||
#include "TypeTraits.h"
|
||||
#include "sls_detector_defs.h"
|
||||
@ -40,11 +39,7 @@ std::string ToString(const defs::timingSourceType s);
|
||||
std::string ToString(const slsDetectorDefs::ROI &roi);
|
||||
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::ROI &roi);
|
||||
|
||||
template <typename T, size_t Capacity>
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const sls::StaticVector<T, Capacity> &c) {
|
||||
return os << ToString(c);
|
||||
}
|
||||
|
||||
|
||||
const std::string &ToString(const std::string &s);
|
||||
|
||||
|
@ -584,7 +584,8 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case NUM_REC_FUNCTIONS: return "NUM_REC_FUNCTIONS";
|
||||
default: return "Unknown Function";
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -50,29 +50,5 @@ implementation should not be used in a performance critical place.
|
||||
*/
|
||||
std::vector<std::string> split(const std::string &strToSplit, char delimeter);
|
||||
|
||||
/*
|
||||
Concatenate the non empty strings in the vector using +
|
||||
*/
|
||||
std::string concatenateNonEmptyStrings(const std::vector<std::string> &vec);
|
||||
|
||||
/*
|
||||
Concatenate strings using + if the strings are different
|
||||
*/
|
||||
std::string concatenateIfDifferent(const std::vector<std::string> &container);
|
||||
|
||||
/*
|
||||
Concatenate vector of things with str method using + if the strings are
|
||||
different
|
||||
*/
|
||||
template <typename T>
|
||||
std::string concatenateIfDifferent(const std::vector<T> &container);
|
||||
|
||||
/*
|
||||
Convert an ip address string to a string in hex format. (removing dots)
|
||||
*/
|
||||
std::string stringIpToHex(const std::string &ip);
|
||||
|
||||
// remove the end of the string starting with the first aplhabetic character
|
||||
// return the end
|
||||
std::string RemoveUnit(std::string &str);
|
||||
}; // namespace sls
|
||||
} // namespace sls
|
||||
|
Reference in New Issue
Block a user