|
|
|||
File indexing completed on 2026-09-15 09:18:31
0001 #ifndef PODIO_ARROWFRAMECONVERTER_H 0002 #define PODIO_ARROWFRAMECONVERTER_H 0003 0004 #include <memory> 0005 #include <string> 0006 #include <vector> 0007 0008 namespace arrow { 0009 class DataType; 0010 class Table; 0011 } // namespace arrow 0012 0013 namespace podio { 0014 0015 class Frame; 0016 0017 /** 0018 * @brief Get the standard Arrow DataType for object references/IDs. 0019 */ 0020 std::shared_ptr<arrow::DataType> objectRefType(); 0021 0022 /** 0023 * @brief Convert a PODIO Frame to an Arrow Table (1-row). 0024 * 0025 * Each collection specified in collsToWrite is mapped to a column of type List<Struct<...>>. 0026 * Metadata about the concrete collection value type is stored in each column field's KeyValueMetadata 0027 * under the key "value_type" (e.g. "value_type" -> "ExampleHit"). 0028 * 0029 * Frame parameters (podio::GenericParameters) are converted and included under the column "frame_parameters". 0030 * 0031 * @param frame The Frame containing collections to convert. 0032 * @param collsToWrite The names of the collections to write to the Table. 0033 * @return A shared pointer to the created 1-row Arrow Table. 0034 */ 0035 std::shared_ptr<arrow::Table> convertFrameToTable(const podio::Frame& frame, 0036 const std::vector<std::string>& collsToWrite); 0037 0038 /** 0039 * @brief Convert a 1-row slice of an Arrow Table to a PODIO Frame. 0040 * 0041 * Reconstructs the frame parameters and all collection buffers using registered BufferReaderFuncs. 0042 * 0043 * @param table The Arrow Table containing the frame data. 0044 * @param rowIndex The index of the row to read. 0045 * @return The reconstructed Frame. 0046 */ 0047 podio::Frame convertTableToFrame(const std::shared_ptr<arrow::Table>& table, int rowIndex = 0); 0048 0049 } // namespace podio 0050 0051 #endif // PODIO_ARROWFRAMECONVERTER_H
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|