Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 09:18:08

0001 // Copyright 2024, Jefferson Science Associates, LLC.
0002 // Subject to the terms in the LICENSE file found in the top-level directory.
0003 // Author: Nathan Brei
0004 
0005 #pragma once
0006 
0007 #include <JANA/Topology/JEventQueue.h>
0008 #include <JANA/Services/JComponentManager.h>
0009 #include <unordered_set>
0010 #include <vector>
0011 
0012 
0013 class JEventPool : public JEventQueue {
0014 private:
0015     std::map<JEventLevel, JEventPool*> m_parent_pools;
0016     std::unordered_set<JEvent*> m_pending;
0017 
0018     std::vector<std::shared_ptr<JEvent>> m_owned_events;
0019     std::shared_ptr<JComponentManager> m_component_manager;
0020     JEventLevel m_level;
0021     JLogger m_logger;
0022 
0023 public:
0024     JEventPool(std::shared_ptr<JComponentManager> component_manager,
0025                size_t max_inflight_events,
0026                size_t location_count,
0027                JEventLevel level = JEventLevel::PhysicsEvent);
0028 
0029     void AttachForwardingPool(JEventPool* pool);
0030 
0031     void Scale(size_t capacity);
0032 
0033     void Ingest(JEvent* event, size_t location);
0034 
0035     void NotifyThatAllChildrenFinished(JEvent* event, size_t location);
0036 
0037     void Finalize();
0038 
0039 };
0040 
0041