Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPL: remove bloat #13841

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Framework/Core/include/Framework/DataDescriptorQueryBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
#include <string>
#include <vector>
#include <memory>
#include <regex>

namespace o2
{
namespace framework

namespace o2::framework
{

namespace data_matcher
Expand Down Expand Up @@ -65,9 +63,9 @@ struct DataDescriptorQueryBuilder {
/// deprecated?
static DataDescriptorQuery buildFromExtendedKeepConfig(std::string const& config);
static std::unique_ptr<data_matcher::DataDescriptorMatcher> buildNode(std::string const& nodeString);
static std::smatch getTokens(std::string const& nodeString);
static std::vector<std::string> getTokens(std::string const& nodeString);
};

} // namespace framework
} // namespace o2
} // namespace o2::framework

#endif // o2_framework_DataDescriptorQueryBuilder_H_INCLUDED
15 changes: 10 additions & 5 deletions Framework/Core/src/DataDescriptorQueryBuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <optional>
#include <string>
#include <vector>
#include <regex>
#include <iostream>

using namespace o2::framework::data_matcher;
Expand Down Expand Up @@ -447,7 +448,7 @@ DataDescriptorQuery DataDescriptorQueryBuilder::buildFromExtendedKeepConfig(std:
std::unique_ptr<DataDescriptorMatcher> DataDescriptorQueryBuilder::buildNode(std::string const& nodeString)
{

std::smatch m = getTokens(nodeString);
auto m = getTokens(nodeString);

std::unique_ptr<DataDescriptorMatcher> next;
auto newNode = std::make_unique<DataDescriptorMatcher>(
Expand All @@ -461,15 +462,19 @@ std::unique_ptr<DataDescriptorMatcher> DataDescriptorQueryBuilder::buildNode(std
return newNode;
}

std::smatch DataDescriptorQueryBuilder::getTokens(std::string const& nodeString)
std::vector<std::string> DataDescriptorQueryBuilder::getTokens(std::string const& nodeString)
{

static const std::regex specTokenRE(R"re((\w{1,4})/(\w{1,16})/(\d*))re");
std::smatch m;
std::smatch match;

std::regex_match(nodeString, m, specTokenRE);
std::regex_match(nodeString, match, specTokenRE);

return m;
std::vector<std::string> result;
for (size_t i = 0; i < 4; ++i) {
result.push_back(match[i].str());
}
return result;
}

} // namespace o2::framework
Loading