Skip to content

Commit

Permalink
Detemplatize JPipelineArrow
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwbrei committed Oct 17, 2024
1 parent a5a3f31 commit ca19a09
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/libraries/JANA/Topology/JEventMapArrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void JEventMapArrow::add_processor(JEventProcessor* processor) {
m_procs.push_back(processor);
}

void JEventMapArrow::process(Event* event, bool& success, JArrowMetrics::Status& status) {
void JEventMapArrow::process(std::shared_ptr<JEvent>* event, bool& success, JArrowMetrics::Status& status) {

LOG_DEBUG(m_logger) << "Executing arrow " << get_name() << " for event# " << (*event)->GetEventNumber() << LOG_END;
for (JEventSource* source : m_sources) {
Expand Down
6 changes: 2 additions & 4 deletions src/libraries/JANA/Topology/JEventMapArrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ class JEventUnfolder;
class JEventProcessor;
class JEvent;

using Event = std::shared_ptr<JEvent>;
using EventQueue = JMailbox<Event*>;

class JEventMapArrow : public JPipelineArrow<JEventMapArrow, Event> {
class JEventMapArrow : public JPipelineArrow<JEventMapArrow> {

private:
std::vector<JEventSource*> m_sources;
Expand All @@ -28,7 +26,7 @@ class JEventMapArrow : public JPipelineArrow<JEventMapArrow, Event> {
void add_unfolder(JEventUnfolder* unfolder);
void add_processor(JEventProcessor* proc);

void process(Event* event, bool& success, JArrowMetrics::Status& status);
void process(std::shared_ptr<JEvent>* event, bool& success, JArrowMetrics::Status& status);

void initialize() final;
void finalize() final;
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/JANA/Topology/JEventProcessorArrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void JEventProcessorArrow::add_processor(JEventProcessor* processor) {
m_processors.push_back(processor);
}

void JEventProcessorArrow::process(Event* event, bool& success, JArrowMetrics::Status& status) {
void JEventProcessorArrow::process(std::shared_ptr<JEvent>* event, bool& success, JArrowMetrics::Status& status) {


LOG_DEBUG(m_logger) << "Executing arrow " << get_name() << " for event# " << (*event)->GetEventNumber() << LOG_END;
Expand Down
8 changes: 2 additions & 6 deletions src/libraries/JANA/Topology/JEventProcessorArrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@
#include <JANA/JEventProcessor.h>
#include <JANA/Topology/JPipelineArrow.h>

class JEventPool;

using Event = std::shared_ptr<JEvent>;
using EventQueue = JMailbox<Event*>;

class JEventProcessorArrow : public JPipelineArrow<JEventProcessorArrow, Event> {
class JEventProcessorArrow : public JPipelineArrow<JEventProcessorArrow> {

private:
std::vector<JEventProcessor*> m_processors;

public:
JEventProcessorArrow(std::string name);
void add_processor(JEventProcessor* processor);
void process(Event* event, bool& success, JArrowMetrics::Status& status);
void process(std::shared_ptr<JEvent>* event, bool& success, JArrowMetrics::Status& status);
void initialize() final;
void finalize() final;
};
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/JANA/Topology/JEventTapArrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void JEventTapArrow::add_processor(JEventProcessor* proc) {
m_procs.push_back(proc);
}

void JEventTapArrow::process(Event* event, bool& success, JArrowMetrics::Status& status) {
void JEventTapArrow::process(std::shared_ptr<JEvent>* event, bool& success, JArrowMetrics::Status& status) {

LOG_DEBUG(m_logger) << "Executing arrow " << get_name() << " for event# " << (*event)->GetEventNumber() << LOG_END;
for (JEventProcessor* proc : m_procs) {
Expand Down
7 changes: 2 additions & 5 deletions src/libraries/JANA/Topology/JEventTapArrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@

#include <JANA/Topology/JPipelineArrow.h>

class JEventPool;
class JEventProcessor;
class JEvent;

using Event = std::shared_ptr<JEvent>;
using EventQueue = JMailbox<Event*>;

class JEventTapArrow : public JPipelineArrow<JEventTapArrow, Event> {
class JEventTapArrow : public JPipelineArrow<JEventTapArrow> {

private:
std::vector<JEventProcessor*> m_procs;
Expand All @@ -21,7 +18,7 @@ class JEventTapArrow : public JPipelineArrow<JEventTapArrow, Event> {
JEventTapArrow(std::string name);

void add_processor(JEventProcessor* proc);
void process(Event* event, bool& success, JArrowMetrics::Status& status);
void process(std::shared_ptr<JEvent>* event, bool& success, JArrowMetrics::Status& status);
void initialize() final;
void finalize() final;
};
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/JANA/Topology/JPipelineArrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <JANA/Topology/JMailbox.h>
#include <JANA/Topology/JPool.h>

using EventT = std::shared_ptr<JEvent>;
using MessageT = std::shared_ptr<JEvent>;

template <typename DerivedT, typename MessageT=EventT>
template <typename DerivedT>
class JPipelineArrow : public JArrow {
private:
Place m_input {this, true, 1, 1};
Expand Down

0 comments on commit ca19a09

Please sign in to comment.