CatapultServer  v0.5.0.1 (Elephant)
ChunkedDataLoader.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "catapult/io/PodIoUtils.h"
23 #include "catapult/io/Stream.h"
24 #include "catapult/functions.h"
25 
26 namespace catapult { namespace cache {
27 
29  template<typename TStorageTraits>
31  public:
33  explicit ChunkedDataLoader(io::InputStream& input) : m_input(input) {
35  }
36 
37  public:
39  bool hasNext() const {
40  return 0 != m_numRemainingEntries;
41  }
42 
44  void next(uint64_t numRequestedEntries, typename TStorageTraits::DestinationType& destination) {
45  numRequestedEntries = std::min(numRequestedEntries, m_numRemainingEntries);
46  m_numRemainingEntries -= numRequestedEntries;
47  while (numRequestedEntries--)
48  TStorageTraits::LoadInto(TStorageTraits::Load(m_input), destination);
49  }
50 
51  private:
54  };
55 }}
checkProjectStructure.isCppInclude
def isCppInclude(inc)
Definition: checkProjectStructure.py:96
checkProjectStructure.XmlReporter.footer
def footer(self)
Definition: checkProjectStructure.py:437
Observers.h
checkProjectStructure.Entry
Definition: checkProjectStructure.py:228
checkProjectStructure.AutoContainer.__iter__
def __iter__(self)
Definition: checkProjectStructure.py:453
catapult::validators::DEFINE_STATEFUL_VALIDATOR
DEFINE_STATEFUL_VALIDATOR(EligibleHarvester, [](const auto &notification, const auto &context) { cache::ImportanceView view(context.Cache.template sub< cache::AccountStateCache >());return view.canHarvest(notification.Signer, context.Height) ? ValidationResult::Success :Failure_Core_Block_Harvester_Ineligible;})
checkProjectStructure.Analyzer.dependencyViolations
dependencyViolations
Definition: checkProjectStructure.py:464
checkProjectStructure.SortableInclude.__eq__
def __eq__(self, other)
Definition: checkProjectStructure.py:193
checkProjectStructure.Analyzer.printTemplateErrors
def printTemplateErrors(self)
Definition: checkProjectStructure.py:710
checkProjectStructure.Analyzer.printFormattingOut
def printFormattingOut(self, reporter)
Definition: checkProjectStructure.py:591
checkProjectStructure.Analyzer.getShortestNamespaceSet
def getShortestNamespaceSet(cppHeader)
Definition: checkProjectStructure.py:472
checkProjectStructure.Analyzer.presentExclusions
presentExclusions
Definition: checkProjectStructure.py:467
checkProjectStructure.checkExternalInclude
def checkExternalInclude(incA, incB)
Definition: checkProjectStructure.py:83
checkProjectStructure.FilteredReporter.xml
xml
Definition: checkProjectStructure.py:371
checkProjectStructure.Entry.setTemplateErrors
def setTemplateErrors(self, templateErrors)
Definition: checkProjectStructure.py:252
NamespaceCache.h
checkProjectStructure.IncludesError.includes
includes
Definition: checkProjectStructure.py:225
checkProjectStructure.Entry.filename
filename
Definition: checkProjectStructure.py:231
checkProjectStructure.printSectionSeparator
def printSectionSeparator()
Definition: checkProjectStructure.py:840
catapult::cache::ChunkedDataLoader::m_input
io::InputStream & m_input
Definition: ChunkedDataLoader.h:52
checkProjectStructure.Analyzer.validateSetSearch
def validateSetSearch(self, mapName, path)
Definition: checkProjectStructure.py:499
HeaderParser.Include
Definition: HeaderParser.py:48
checkProjectStructure.DepsConsole.args
args
Definition: checkProjectStructure.py:721
checkProjectStructure.FirstIncludeError
Definition: checkProjectStructure.py:215
checkProjectStructure.IncludesError.__init__
def __init__(self, path, includes)
Definition: checkProjectStructure.py:223
checkProjectStructure.findAccessibleSourceDirs
def findAccessibleSourceDirs()
Definition: checkProjectStructure.py:829
ValidatorContext.h
catapult::validators::Notification
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
checkProjectStructure.Analyzer.options
options
Definition: checkProjectStructure.py:468
checkProjectStructure.Analyzer.printDependenciesOut
def printDependenciesOut(self, reporter)
Definition: checkProjectStructure.py:632
checkProjectStructure.Analyzer.add
def add(self, entry)
Definition: checkProjectStructure.py:520
checkProjectStructure.Analyzer.sourceDirs
sourceDirs
Definition: checkProjectStructure.py:469
checkProjectStructure.DepsConsole.includeFilter
def includeFilter(path)
Definition: checkProjectStructure.py:724
catapult::observers::DEFINE_OBSERVER
DEFINE_OBSERVER(AccountAddress, model::AccountAddressNotification, [](const auto &notification, const auto &context) { DefaultAccountVisitor visitor(context);visitor.visit(notification.Address);})
checkProjectStructure.AnalyzerOptions.textOutput
textOutput
Definition: checkProjectStructure.py:47
checkProjectStructure.Analyzer.includes
includes
Definition: checkProjectStructure.py:462
checkProjectStructure.parseArgs
def parseArgs()
Definition: checkProjectStructure.py:791
DepsChecker.DepsChecker
Definition: DepsChecker.py:15
checkProjectStructure.FirstIncludeError.__init__
def __init__(self, path, include, actual)
Definition: checkProjectStructure.py:216
checkProjectStructure.DepsConsole.check
def check(self, includes)
Definition: checkProjectStructure.py:737
checkProjectStructure.SortableInclude.ruleset
ruleset
Definition: checkProjectStructure.py:155
checkProjectStructure.Analyzer.printTemplateErrorsOut
def printTemplateErrorsOut(self, reporter)
Definition: checkProjectStructure.py:695
functions.h
HeaderParser.HeaderParser
Definition: HeaderParser.py:84
checkProjectStructure.checkCppInclude
def checkCppInclude(incA, incB)
Definition: checkProjectStructure.py:101
checkProjectStructure.main
def main()
Definition: checkProjectStructure.py:847
Parser.NamespacesParser
Definition: Parser.py:130
checkProjectStructure.Analyzer
Definition: checkProjectStructure.py:460
checkProjectStructure.checkLocalInclude
def checkLocalInclude(pathA, pathB)
Definition: checkProjectStructure.py:117
checkProjectStructure.AutoContainer.__init__
def __init__(self)
Definition: checkProjectStructure.py:442
checkProjectStructure.AutoContainer.__getitem__
def __getitem__(self, key)
Definition: checkProjectStructure.py:445
catapult::cache::ChunkedDataLoader::ChunkedDataLoader
ChunkedDataLoader(io::InputStream &input)
Creates a chunked loader around input.
Definition: ChunkedDataLoader.h:33
checkProjectStructure.ErrorDataCollector.__init__
def __init__(self, description)
Definition: checkProjectStructure.py:362
checkProjectStructure.AutoContainer.__len__
def __len__(self)
Definition: checkProjectStructure.py:450
checkProjectStructure.FilteredReporter.__call__
def __call__(self, groupName, err)
Definition: checkProjectStructure.py:373
checkProjectStructure.Entry.includeFixOwnPath
includeFixOwnPath
Definition: checkProjectStructure.py:239
checkProjectStructure.AnalyzerOptions.fixIndents
fixIndents
Definition: checkProjectStructure.py:48
checkProjectStructure.XmlReporter.suite
def suite(self, suiteName, overallCount, errors)
Definition: checkProjectStructure.py:430
checkProjectStructure.DepsConsole.depsPrint
def depsPrint(self, deps)
Definition: checkProjectStructure.py:727
checkProjectStructure.AnalyzerOptions.verbose
verbose
Definition: checkProjectStructure.py:50
checkProjectStructure.XmlReporter.__init__
def __init__(self, f)
Definition: checkProjectStructure.py:415
catapult::io::InputStream
Reader interface.
Definition: Stream.h:27
checkProjectStructure.Entry.setNamespaces
def setNamespaces(self, namespaces)
Definition: checkProjectStructure.py:249
checkProjectStructure.Analyzer.printNamespaceErrorsOut
def printNamespaceErrorsOut(self, reporter)
Definition: checkProjectStructure.py:656
checkProjectStructure.CheckResult
Definition: checkProjectStructure.py:76
checkProjectStructure.setupOptions
def setupOptions(analyzerOptions, args)
Definition: checkProjectStructure.py:812
checkProjectStructure.ErrorDataCollector
Definition: checkProjectStructure.py:361
checkProjectStructure.AnalyzerOptions.depsSrcOnly
depsSrcOnly
Definition: checkProjectStructure.py:52
checkProjectStructure.Entry.check
def check(self)
Definition: checkProjectStructure.py:255
checkProjectStructure.isSpecialInclude
def isSpecialInclude(includePath)
Definition: checkProjectStructure.py:69
catapult::cache::ChunkedDataLoader::next
void next(uint64_t numRequestedEntries, typename TStorageTraits::DestinationType &destination)
Loads the next data chunk of at most numRequestedEntries into destination.
Definition: ChunkedDataLoader.h:44
checkProjectStructure.IncludesError
Definition: checkProjectStructure.py:222
checkProjectStructure.FilteredReporter
Definition: checkProjectStructure.py:369
checkProjectStructure.XmlReporter
Definition: checkProjectStructure.py:414
checkProjectStructure.Entry.path
path
Definition: checkProjectStructure.py:230
checkProjectStructure.Entry.checkCrossIncludes
def checkCrossIncludes(self, errorReporter, sortedIncludes, pathElements)
Definition: checkProjectStructure.py:288
checkProjectStructure.Analyzer.printNamespaces
def printNamespaces(self)
Definition: checkProjectStructure.py:687
checkProjectStructure.SortableInclude.__lt__
def __lt__(self, other)
Definition: checkProjectStructure.py:196
checkProjectStructure.Analyzer.validateSet
def validateSet(self, mapName, path)
Definition: checkProjectStructure.py:494
checkProjectStructure.checkIncludeDepth
def checkIncludeDepth(pathA, pathB)
Definition: checkProjectStructure.py:134
checkProjectStructure.FirstIncludeError.actual
actual
Definition: checkProjectStructure.py:219
checkProjectStructure.AnalyzerOptions.depsFilter
depsFilter
Definition: checkProjectStructure.py:51
Validators.h
checkProjectStructure.XmlReporter.header
def header(self, testsCount, failuresCount)
Definition: checkProjectStructure.py:425
checkProjectStructure.FirstIncludeError.path
path
Definition: checkProjectStructure.py:217
checkProjectStructure.checkDependencies
def checkDependencies(includes, depsChecker, args)
Definition: checkProjectStructure.py:770
catapult::cache::ChunkedDataLoader
Loads data from an input stream in chunks.
Definition: ChunkedDataLoader.h:30
checkProjectStructure.Analyzer.printFormatting
def printFormatting(self)
Definition: checkProjectStructure.py:553
checkProjectStructure.ConReporter
Definition: checkProjectStructure.py:390
checkProjectStructure.ConReporter.formatFailure
def formatFailure(buff, kind, name, msg)
Definition: checkProjectStructure.py:395
checkProjectStructure.Analyzer.__init__
def __init__(self, options)
Definition: checkProjectStructure.py:461
catapult::cache::ChunkedDataLoader::hasNext
bool hasNext() const
Returns true if there are more entries in the input.
Definition: ChunkedDataLoader.h:39
checkProjectStructure.ConReporter.footer
def footer(self)
Definition: checkProjectStructure.py:409
catapult::validators::ValidationResult::Success
Validation succeeded.
checkProjectStructure.Analyzer.filter
def filter(self, expectedResult)
Definition: checkProjectStructure.py:653
checkProjectStructure.Entry.namespaces
namespaces
Definition: checkProjectStructure.py:234
checkProjectStructure.Analyzer.simpleValidators
simpleValidators
Definition: checkProjectStructure.py:466
checkProjectStructure.ConReporter.__init__
def __init__(self)
Definition: checkProjectStructure.py:391
checkProjectStructure.XmlReporter.formatFailure
def formatFailure(buff, kind, name, msg)
Definition: checkProjectStructure.py:419
checkProjectStructure.Analyzer.conReporter
conReporter
Definition: checkProjectStructure.py:465
checkProjectStructure.Entry.templateErrors
templateErrors
Definition: checkProjectStructure.py:235
checkProjectStructure.AutoContainer.items
def items(self)
Definition: checkProjectStructure.py:456
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::io::Read64
auto Read64(TIo &input)
Reads value from input.
Definition: PodIoUtils.h:66
checkProjectStructure.ErrorDataCollector.__call__
def __call__(self, groupName, value)
Definition: checkProjectStructure.py:365
checkProjectStructure.ConReporter.totalFailures
totalFailures
Definition: checkProjectStructure.py:392
checkProjectStructure.Entry.fixRelative
def fixRelative(self, elem)
Definition: checkProjectStructure.py:279
checkProjectStructure.SortableInclude.__init__
def __init__(self, inc, ruleset)
Definition: checkProjectStructure.py:153
PodIoUtils.h
checkProjectStructure.depsCheckDir
def depsCheckDir(args, path)
Definition: checkProjectStructure.py:759
checkProjectStructure.SortableInclude.isLibraryInclude
def isLibraryInclude(name)
Definition: checkProjectStructure.py:158
checkProjectStructure.filterNonProjectIncludes
def filterNonProjectIncludes(includes)
Definition: checkProjectStructure.py:355
checkProjectStructure.AnalyzerOptions.destDir
destDir
Definition: checkProjectStructure.py:49
checkProjectStructure.Analyzer.context
context
Definition: checkProjectStructure.py:463
checkProjectStructure.Entry.setIncludes
def setIncludes(self, includes)
Definition: checkProjectStructure.py:246
checkProjectStructure.DepsConsole
Definition: checkProjectStructure.py:719
checkProjectStructure.ConReporter.header
def header(self, testsCount, failuresCount)
Definition: checkProjectStructure.py:399
checkProjectStructure.Entry.fullPath
def fullPath(self)
Definition: checkProjectStructure.py:243
checkProjectStructure.Analyzer.getExclusionErrors
def getExclusionErrors(self, reporter)
Definition: checkProjectStructure.py:571
checkProjectStructure.Entry.checkIncludes
def checkIncludes(self, errorReporter, preprocessor)
Definition: checkProjectStructure.py:294
checkProjectStructure.ConReporter.suite
def suite(self, suiteName, overallCount, errors)
Definition: checkProjectStructure.py:402
checkProjectStructure.Entry.includes
includes
Definition: checkProjectStructure.py:233
Stream.h
validation.createValidators
def createValidators(errorReporter)
Definition: validation.py:1223
checkProjectStructure.Analyzer.validateSetPathFix
def validateSetPathFix(self, mapName, path)
Definition: checkProjectStructure.py:504
checkProjectStructure.SortableInclude
Definition: checkProjectStructure.py:152
checkProjectStructure.AnalyzerOptions.__init__
def __init__(self)
Definition: checkProjectStructure.py:46
checkProjectStructure.Entry.__init__
def __init__(self, path, filename, ruleset)
Definition: checkProjectStructure.py:229
checkProjectStructure.IncludesError.path
path
Definition: checkProjectStructure.py:224
checkProjectStructure.DepsConsole.__init__
def __init__(self, args)
Definition: checkProjectStructure.py:720
checkProjectStructure.ErrorDataCollector.description
description
Definition: checkProjectStructure.py:363
checkProjectStructure.Entry.ruleset
ruleset
Definition: checkProjectStructure.py:232
checkProjectStructure.Entry.expectedNamespace
expectedNamespace
Definition: checkProjectStructure.py:236
checkProjectStructure.Analyzer.validateMaps
def validateMaps(self, path)
Definition: checkProjectStructure.py:510
checkProjectStructure.AutoContainer.data
data
Definition: checkProjectStructure.py:443
checkProjectStructure.AutoContainer
Definition: checkProjectStructure.py:441
checkProjectStructure.XmlReporter.fout
fout
Definition: checkProjectStructure.py:416
catapult::cache::ChunkedDataLoader::m_numRemainingEntries
uint64_t m_numRemainingEntries
Definition: ChunkedDataLoader.h:53
checkProjectStructure.AnalyzerOptions
Definition: checkProjectStructure.py:45
checkProjectStructure.Analyzer.printDependencies
def printDependencies(self)
Definition: checkProjectStructure.py:644
checkProjectStructure.SortableInclude.include
include
Definition: checkProjectStructure.py:194
checkProjectStructure.namespaceFilter
def namespaceFilter(namespace)
Definition: checkProjectStructure.py:341
checkProjectStructure.FilteredReporter.__init__
def __init__(self, description)
Definition: checkProjectStructure.py:370
checkProjectStructure.FirstIncludeError.include
include
Definition: checkProjectStructure.py:218
checkProjectStructure.Analyzer.shouldIgnoreMissingExclusion
def shouldIgnoreMissingExclusion(self, missingExcl)
Definition: checkProjectStructure.py:562
checkProjectStructure.SortableInclude.comparePaths
def comparePaths(self, other)
Definition: checkProjectStructure.py:164