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,
|
||||
ParserContext &parserContext, mana::ModuleDataStage &analysisContext)
|
||||
ParserContext &parserContext)
|
||||
{
|
||||
listfileContext.readerHelper.destBuf().clear();
|
||||
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;
|
||||
|
||||
auto bufferView = buffer->viewU32();
|
||||
parserContext.parser.userContext = &analysisContext;
|
||||
|
||||
mvlc::readout_parser::parse_readout_buffer(
|
||||
listfileContext.readerHelper.bufferFormat, parserContext.parser, parserContext.callbacks,
|
||||
|
@ -226,6 +231,8 @@ int main(int argc, char *argv[])
|
|||
if (!parserContext)
|
||||
return 1;
|
||||
|
||||
parserContext->parser.userContext = &mana;
|
||||
|
||||
mana.sinkContext = mana.sink->init();
|
||||
mana.sink->begin_run(mana.sinkContext, mana.runDescriptor.dump().c_str());
|
||||
|
||||
|
@ -249,7 +256,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
do
|
||||
{
|
||||
bytesProcessed = process_one_buffer(bufferNumber, *listfileContext, *parserContext, mana);
|
||||
bytesProcessed = process_one_buffer(bufferNumber, *listfileContext, *parserContext);
|
||||
totalBytesProcessed += bytesProcessed;
|
||||
++bufferNumber;
|
||||
|
||||
|
|
Loading…
Reference in a new issue