Skip to content

Commit

Permalink
change printing flag to get functions
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienDoerner committed Sep 3, 2024
1 parent c530480 commit 63a1a31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions include/crpropa/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ class AbstractCondition: public Module {
void setRejectFlag(std::string key, std::string value);
void setAcceptFlag(std::string key, std::string value);

void printRejectFlag();
void printAcceptFlag();
// return the reject flag (key & value), delimiter is the "&".
std::string getRejectFlag();

// return the accept flag (key & value), delimiter is the "&"
std::string getAcceptFlag();
};

/**
Expand Down
10 changes: 6 additions & 4 deletions src/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ void AbstractCondition::setAcceptFlag(std::string key, std::string value) {
acceptFlagValue = value;
}

void AbstractCondition::printRejectFlag() {
std::cout << "rejectKey: " << rejectFlagKey << " with flag: " << rejectFlagValue << "\n";
std::string AbstractCondition::getRejectFlag() {
std::string out = rejectFlagKey + "&" + rejectFlagValue;
return out;
}

void AbstractCondition::printAcceptFlag() {
std::cout << "acceptKey: " << acceptFlagKey << " with flag: " << acceptFlagValue << "\n";
std::string AbstractCondition::getAcceptFlag() {
std::string out = acceptFlagKey + "&" + acceptFlagValue;
return out;
}


Expand Down

0 comments on commit 63a1a31

Please sign in to comment.