Skip to content

Commit 5eed91d

Browse files
authored
Merge pull request #152 from alibuild/alibot-cleanup-15625
2 parents 4686896 + d7514a3 commit 5eed91d

1 file changed

Lines changed: 66 additions & 66 deletions

File tree

  • Framework/Core/include/Framework

Framework/Core/include/Framework/ASoA.h

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,73 +2370,73 @@ consteval static std::string_view namespace_prefix()
23702370
}; \
23712371
[[maybe_unused]] static constexpr o2::framework::expressions::BindingNode _Getter_ { _Label_, _Name_::hash, o2::framework::expressions::selectArrowType<_Type_>() }
23722372

2373-
#define DECLARE_SOA_CCDB_COLUMN_FULL(_Name_, _Label_, _Getter_, _ConcreteType_, _CCDBQuery_, _RunDependent_, ...) \
2374-
struct _Name_ : o2::soa::Column<int64_t[3], _Name_> { \
2375-
static constexpr const char* mLabel = _Label_; \
2376-
static constexpr const char* query = _CCDBQuery_; \
2377-
/* How the object is keyed in CCDB: 0 queries by timestamp alone, 1 additionally sends */ \
2378-
/* the run number as "runNumber" metadata (o2::ccdb run-dependent objects), 2 uses the */ \
2379-
/* run number in place of the timestamp. A non-zero value needs the column's table to */ \
2380-
/* be uniform in the run number, since that is where the run comes from. */ \
2381-
static constexpr int run_dependent = _RunDependent_; \
2373+
#define DECLARE_SOA_CCDB_COLUMN_FULL(_Name_, _Label_, _Getter_, _ConcreteType_, _CCDBQuery_, _RunDependent_, ...) \
2374+
struct _Name_ : o2::soa::Column<int64_t[3], _Name_> { \
2375+
static constexpr const char* mLabel = _Label_; \
2376+
static constexpr const char* query = _CCDBQuery_; \
2377+
/* How the object is keyed in CCDB: 0 queries by timestamp alone, 1 additionally sends */ \
2378+
/* the run number as "runNumber" metadata (o2::ccdb run-dependent objects), 2 uses the */ \
2379+
/* run number in place of the timestamp. A non-zero value needs the column's table to */ \
2380+
/* be uniform in the run number, since that is where the run comes from. */ \
2381+
static constexpr int run_dependent = _RunDependent_; \
23822382
static constexpr const uint32_t hash = compile_time_hash(namespace_prefix<_Name_>(), std::string_view{#_Getter_}); \
2383-
static constexpr bool needs_ptr_rec = true; \
2384-
/* Post-deserialisation fixup for objects which are not usable straight out of the ROOT */ \
2385-
/* streamer, e.g. FlatObjects whose internal pointers must be rectified first. Runs on */ \
2386-
/* the receiving device, once per (re)deserialisation, before the object is ever handed */ \
2387-
/* out. Returns the object to cache: a finaliser returning a different instance owns */ \
2388-
/* disposing of the one it was given. */ \
2389-
using finaliser_t = _ConcreteType_* (*)(_ConcreteType_*); \
2390-
static constexpr finaliser_t finalise = __VA_ARGS__; \
2391-
std::function<std::byte*(fair::mq::shmem::MetaHeader&&)> const* ptrRec = nullptr; \
2392-
using base = o2::soa::Column<int64_t[3], _Name_>; \
2393-
using type = int64_t[3]; \
2394-
using column_t = _Name_; \
2395-
_Name_(arrow::ChunkedArray const* column) \
2396-
: o2::soa::Column<int64_t[3], _Name_>(o2::soa::ColumnIterator<int64_t[3]>(column)) \
2397-
{ \
2398-
} \
2399-
\
2400-
_Name_() = default; \
2401-
_Name_(_Name_ const& other) = default; \
2402-
_Name_& operator=(_Name_ const& other) = default; \
2403-
\
2404-
decltype(auto) _Getter_() const \
2405-
{ \
2406-
auto& [handle, segment, size] = *mColumnIterator; \
2407-
auto span = std::span<std::byte>{(*ptrRec)(fair::mq::shmem::MetaHeader{ \
2408-
static_cast<size_t>(size), \
2409-
0, handle, 0, 0, \
2410-
static_cast<uint16_t>(segment), true}), \
2411-
static_cast<size_t>(size)}; \
2412-
if constexpr (std::same_as<_ConcreteType_, std::span<std::byte>>) { \
2413-
return span; \
2414-
} else { \
2415-
static std::byte* payload = nullptr; \
2416-
static _ConcreteType_* deserialised = nullptr; \
2417-
static TClass* c = TClass::GetClass(#_ConcreteType_); \
2418-
if (payload != (std::byte*)span.data()) { \
2419-
payload = (std::byte*)span.data(); \
2420-
delete deserialised; \
2421-
TBufferFile f(TBufferFile::EMode::kRead, span.size(), (char*)span.data(), kFALSE); \
2422-
auto* streamed = (_ConcreteType_*)soa::extractCCDBPayload((char*)payload, span.size(), c, "ccdb_object"); \
2423-
if (!streamed) { \
2424-
LOGP(fatal, \
2425-
"Could not deserialise a {} from the CCDB payload for {} ({} bytes). Check the configured " \
2426-
"path (option \"ccdb:{}\") and that the object exists for this timestamp.", \
2427-
#_ConcreteType_, _CCDBQuery_, span.size(), _Label_); \
2428-
} \
2429-
deserialised = finalise(streamed); \
2430-
} \
2431-
return *deserialised; \
2432-
} \
2433-
} \
2434-
\
2435-
decltype(auto) \
2436-
get() const \
2437-
{ \
2438-
return _Getter_(); \
2439-
} \
2383+
static constexpr bool needs_ptr_rec = true; \
2384+
/* Post-deserialisation fixup for objects which are not usable straight out of the ROOT */ \
2385+
/* streamer, e.g. FlatObjects whose internal pointers must be rectified first. Runs on */ \
2386+
/* the receiving device, once per (re)deserialisation, before the object is ever handed */ \
2387+
/* out. Returns the object to cache: a finaliser returning a different instance owns */ \
2388+
/* disposing of the one it was given. */ \
2389+
using finaliser_t = _ConcreteType_* (*)(_ConcreteType_*); \
2390+
static constexpr finaliser_t finalise = __VA_ARGS__; \
2391+
std::function<std::byte*(fair::mq::shmem::MetaHeader&&)> const* ptrRec = nullptr; \
2392+
using base = o2::soa::Column<int64_t[3], _Name_>; \
2393+
using type = int64_t[3]; \
2394+
using column_t = _Name_; \
2395+
_Name_(arrow::ChunkedArray const* column) \
2396+
: o2::soa::Column<int64_t[3], _Name_>(o2::soa::ColumnIterator<int64_t[3]>(column)) \
2397+
{ \
2398+
} \
2399+
\
2400+
_Name_() = default; \
2401+
_Name_(_Name_ const& other) = default; \
2402+
_Name_& operator=(_Name_ const& other) = default; \
2403+
\
2404+
decltype(auto) _Getter_() const \
2405+
{ \
2406+
auto& [handle, segment, size] = *mColumnIterator; \
2407+
auto span = std::span<std::byte>{(*ptrRec)(fair::mq::shmem::MetaHeader{ \
2408+
static_cast<size_t>(size), \
2409+
0, handle, 0, 0, \
2410+
static_cast<uint16_t>(segment), true}), \
2411+
static_cast<size_t>(size)}; \
2412+
if constexpr (std::same_as<_ConcreteType_, std::span<std::byte>>) { \
2413+
return span; \
2414+
} else { \
2415+
static std::byte* payload = nullptr; \
2416+
static _ConcreteType_* deserialised = nullptr; \
2417+
static TClass* c = TClass::GetClass(#_ConcreteType_); \
2418+
if (payload != (std::byte*)span.data()) { \
2419+
payload = (std::byte*)span.data(); \
2420+
delete deserialised; \
2421+
TBufferFile f(TBufferFile::EMode::kRead, span.size(), (char*)span.data(), kFALSE); \
2422+
auto* streamed = (_ConcreteType_*)soa::extractCCDBPayload((char*)payload, span.size(), c, "ccdb_object"); \
2423+
if (!streamed) { \
2424+
LOGP(fatal, \
2425+
"Could not deserialise a {} from the CCDB payload for {} ({} bytes). Check the configured " \
2426+
"path (option \"ccdb:{}\") and that the object exists for this timestamp.", \
2427+
#_ConcreteType_, _CCDBQuery_, span.size(), _Label_); \
2428+
} \
2429+
deserialised = finalise(streamed); \
2430+
} \
2431+
return *deserialised; \
2432+
} \
2433+
} \
2434+
\
2435+
decltype(auto) \
2436+
get() const \
2437+
{ \
2438+
return _Getter_(); \
2439+
} \
24402440
};
24412441

24422442
/* Conventional label, and the object used exactly as the ROOT streamer produced it. Reach

0 commit comments

Comments
 (0)