26 oss <<
val.get<
int>();
29 oss << (int)
val.get<int8_t>();
32 oss << (int)
val.get<int16_t>();
35 oss << (int)
val.get<uint8_t>();
38 oss << (int)
val.get<uint16_t>();
41 oss <<
val.get<uint32_t>();
44 oss <<
val.get<uint64_t>();
50 oss <<
val.get<
float>();
53 oss <<
val.get<
double>();
56 oss <<
val.get<
const char*>();
59 oss <<
val.get<
bool>();
98 f.template operator()<std::vector<std::string>>();
147 return reinterpret_cast<T*
>(std::memcpy(std::malloc(
size *
sizeof(T)),
values,
size *
sizeof(T)));
155 if (!visitStoredObject(mType, [
this]<
typename T>() {
new (&mStore) T{}; })) {
156 std::memset(&mStore, 0,
sizeof(mStore));
174 if (visitStoredObject(mType, [
this, &
other]<
typename T>() {
new (&mStore) T(*
reinterpret_cast<T const*
>(&
other.mStore)); })) {
180 auto const*
value = *
reinterpret_cast<char const* const*
>(&
other.mStore);
181 *
reinterpret_cast<char**
>(&mStore) =
value !=
nullptr ? strdup(
value) :
nullptr;
185 *
reinterpret_cast<int**
>(&mStore) =
copyBuffer(*
reinterpret_cast<int* const*
>(&
other.mStore), mSize);
188 *
reinterpret_cast<float**
>(&mStore) =
copyBuffer(*
reinterpret_cast<float* const*
>(&
other.mStore), mSize);
191 *
reinterpret_cast<double**
>(&mStore) =
copyBuffer(*
reinterpret_cast<double* const*
>(&
other.mStore), mSize);
194 *
reinterpret_cast<bool**
>(&mStore) =
copyBuffer(*
reinterpret_cast<bool* const*
>(&
other.mStore), mSize);
198 mStore =
other.mStore;
202void Variant::moveStore(Variant&
other)
noexcept
205 if (visitStoredObject(mType, [
this, &
other]<
typename T>() {
new (&mStore)
T(std::move(*
reinterpret_cast<T*
>(&
other.mStore))); })) {
208 mStore =
other.mStore;
210 if (holdsMallocedPointer(mType)) {
211 *
reinterpret_cast<void**
>(&
other.mStore) =
nullptr;
215void Variant::destroyStore() noexcept
218 if (visitStoredObject(mType, [
this]<
typename T>() { std::destroy_at(
reinterpret_cast<T*
>(&mStore)); })) {
222 if (holdsMallocedPointer(mType)) {
223 free(*
reinterpret_cast<void**
>(&mStore));
244 if (
this != &
other) {
247 *
this = std::move(copy);
254 if (
this != &
other) {
263std::pair<std::vector<std::string>, std::vector<std::string>>
extractLabels(boost::property_tree::ptree
const&
tree)
267 auto lrc =
tree.get_child_optional(labels_rows_str);
269 labels_rows = basicVectorFromBranch<std::string>(lrc.value());
271 auto lcc =
tree.get_child_optional(labels_cols_str);
273 labels_cols = basicVectorFromBranch<std::string>(lcc.value());
std::vector< std::string > labels_rows
std::vector< std::string > labels_cols
Variant for configuration parameter storage. Owns stored data.
std::string asString() const
Variant & operator=(const Variant &other)
Variant(VariantType type=VariantType::Unknown)
GLsizei const GLfloat * value
GLint GLint GLsizei GLint GLenum GLenum type
GLenum GLsizei GLsizei GLint * values
Defining ITS Vertex explicitly as messageable.
std::ostream & operator<<(std::ostream &s, ChannelType const &type)
Stream operators so that we can use ChannelType with Boost.Test.
std::pair< std::vector< std::string >, std::vector< std::string > > extractLabels(boost::property_tree::ptree const &tree)
size_t copyBuffer(const std::vector< uint64_t > &b64, std::vector< std::byte > &b8, uint64_t prefix=0)
static void write(std::ostream &o, Variant const &v)
VectorOfTObjectPtrs other
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))