mana: don't need to pass analysisContext to process_one_buffer()
This commit is contained in:
parent
13c73cfdfc
commit
76b22c1434
1 changed files with 10 additions and 3 deletions
|
@ -135,8 +135,14 @@ std::optional<ParserContext> make_parser_context(const mvlc::CrateConfig &crateC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct ProcessingStrategy
|
||||||
|
{
|
||||||
|
virtual ~ProcessingStrategy() = default;
|
||||||
|
virtual void run(ListfileContext &listfileContext, ParserContext &parserContext) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
size_t process_one_buffer(size_t bufferNumber, ListfileContext &listfileContext,
|
size_t process_one_buffer(size_t bufferNumber, ListfileContext &listfileContext,
|
||||||
ParserContext &parserContext, mana::ModuleDataStage &analysisContext)
|
ParserContext &parserContext)
|
||||||
{
|
{
|
||||||
listfileContext.readerHelper.destBuf().clear();
|
listfileContext.readerHelper.destBuf().clear();
|
||||||
auto buffer = mvlc::listfile::read_next_buffer(listfileContext.readerHelper);
|
auto buffer = mvlc::listfile::read_next_buffer(listfileContext.readerHelper);
|
||||||
|
@ -145,7 +151,6 @@ size_t process_one_buffer(size_t bufferNumber, ListfileContext &listfileContext,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
auto bufferView = buffer->viewU32();
|
auto bufferView = buffer->viewU32();
|
||||||
parserContext.parser.userContext = &analysisContext;
|
|
||||||
|
|
||||||
mvlc::readout_parser::parse_readout_buffer(
|
mvlc::readout_parser::parse_readout_buffer(
|
||||||
listfileContext.readerHelper.bufferFormat, parserContext.parser, parserContext.callbacks,
|
listfileContext.readerHelper.bufferFormat, parserContext.parser, parserContext.callbacks,
|
||||||
|
@ -226,6 +231,8 @@ int main(int argc, char *argv[])
|
||||||
if (!parserContext)
|
if (!parserContext)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
parserContext->parser.userContext = &mana;
|
||||||
|
|
||||||
mana.sinkContext = mana.sink->init();
|
mana.sinkContext = mana.sink->init();
|
||||||
mana.sink->begin_run(mana.sinkContext, mana.runDescriptor.dump().c_str());
|
mana.sink->begin_run(mana.sinkContext, mana.runDescriptor.dump().c_str());
|
||||||
|
|
||||||
|
@ -249,7 +256,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
bytesProcessed = process_one_buffer(bufferNumber, *listfileContext, *parserContext, mana);
|
bytesProcessed = process_one_buffer(bufferNumber, *listfileContext, *parserContext);
|
||||||
totalBytesProcessed += bytesProcessed;
|
totalBytesProcessed += bytesProcessed;
|
||||||
++bufferNumber;
|
++bufferNumber;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue