File indexing completed on 2025-08-28 09:13:20
0001
0002 #include <JANA/Topology/JArrow.h>
0003
0004
0005 class JMultilevelSourceArrow : public JArrow {
0006 public:
0007 enum class Direction { In, Out };
0008
0009 private:
0010 JEventSource* m_source = nullptr;
0011
0012 std::vector<JEventLevel> m_levels;
0013 std::map<std::tuple<JEventLevel, Direction>, size_t> m_port_lookup;
0014 JEventLevel m_child_event_level = JEventLevel::None;
0015 JEventLevel m_next_input_level;
0016
0017 std::unordered_map<JEventLevel, std::pair<JEvent*, size_t>> m_pending_parents;
0018 bool m_finish_in_progress = false;
0019
0020 private:
0021 void EvictNextParent(OutputData& outputs, size_t& output_count);
0022
0023 public:
0024 const std::vector<JEventLevel>& GetLevels() const;
0025 size_t GetPortIndex(JEventLevel level, Direction direction) const;
0026
0027 void SetEventSource(JEventSource* source);
0028
0029 void initialize() override;
0030 void fire(JEvent* input, OutputData& outputs, size_t& output_count, JArrow::FireResult& status) override;
0031 void finalize() override;
0032
0033 };
0034