本文整理汇总了C++中processor函数的典型用法代码示例。如果您正苦于以下问题:C++ processor函数的具体用法?C++ processor怎么用?C++ processor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了processor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: processor
void KeypadProcessor_Tests::OnKeyPressed_WillNotifyAboutDelCharChange_OnlyAfterChangeHasOccurred()
{
QString wholeInputOnChangeNotification;
KeypadProcessor processor([](){}
, [](){}
, [&](){ wholeInputOnChangeNotification = processor.GetWholeInput(); });
processor.OnKeyPressed("1");
processor.OnKeyPressed("2");
processor.OnKeyPressed(KeypadProcessor::delChar);
QCOMPARE(wholeInputOnChangeNotification, QString("1"));
}
开发者ID:kurattila,项目名称:Mentol,代码行数:13,代码来源:KeypadProcessor_Tests.cpp
示例2: ProcessLine
/**************************************************************************
Function : ProcessLine
Parameters: Line character pointer to line of input data
Returns : nothing
If line type has been determined, call correct line processor through
a function pointer. Else try testing for both Tasm style line and Masm
style line to determine if either one is the input to the filter.
**************************************************************************/
void ProcessLine(char *Line)
{
if (processor == NULL)
{
if (ProcessTasmLine(Line)) /* check for TASM line */
processor = ProcessTasmLine;
else
if (ProcessNonTasmLine(Line)) /* check MASM or OPTASM style */
processor = ProcessNonTasmLine;
}
else
processor(Line); /* type already determined */
}
开发者ID:WiLLStenico,项目名称:TestesEOutrasBrincadeiras,代码行数:22,代码来源:tasm2msg.c
示例3: processor
void ClientConnection::processLogs(const std::string& employeeId)
{
LogProcessor processor(employeeId);
processor.checkEmployeeId();
auto& query = findUnprocessedLogEntriesForEmployeeQ();
query.execute(employeeId);
ServerLogEntry entry;
while (query.next(entry))
{
processor.process(std::move(entry));
}
processor.finish();
}
开发者ID:Meehanick,项目名称:-TIN-Karbowy,代码行数:13,代码来源:clientconnection.cpp
示例4: eightbit_to_ucs4
vector<char_type>
eightbit_to_ucs4(char const * s, size_t ls, string const & encoding)
{
static QThreadStorage<map<string, IconvProcessor> *> static_processors;
if (!static_processors.hasLocalData())
static_processors.setLocalData(new map<string, IconvProcessor>);
map<string, IconvProcessor> & processors = *static_processors.localData();
if (processors.find(encoding) == processors.end()) {
IconvProcessor processor(ucs4_codeset, encoding.c_str());
processors.insert(make_pair(encoding, processor));
}
return iconv_convert<char_type>(processors[encoding], s, ls);
}
开发者ID:315234,项目名称:lyx-retina,代码行数:13,代码来源:unicode.cpp
示例5: main
int main(int argc, char* argv[]) {
string runtime;
/* Checks for valid number of arguments passed in. */
if(argc < 2) {
runtime = "10";
}
else {
runtime = argv[1];
}
A3 processor(runtime);
processor.timers();
}
开发者ID:Wooklien,项目名称:Operation-Systems,代码行数:13,代码来源:A3.cpp
示例6: processor
U_NAMESPACE_BEGIN
void GlyphPositioningTableHeader::process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, le_bool rightToLeft,
LETag scriptTag, LETag languageTag,
const GlyphDefinitionTableHeader *glyphDefinitionTableHeader,
const LEFontInstance *fontInstance, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const
{
GlyphPositioningLookupProcessor processor(this, scriptTag, languageTag, featureMap, featureMapCount, featureOrder);
processor.process(glyphStorage, glyphPositionAdjustments, rightToLeft, glyphDefinitionTableHeader, fontInstance);
glyphPositionAdjustments->applyCursiveAdjustments(glyphStorage, rightToLeft, fontInstance);
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:13,代码来源:GlyphPositioningTables.cpp
示例7: processor
void CppEditorDocument::setPreprocessorSettings(const CppTools::ProjectPart::Ptr &projectPart,
const QByteArray &defines)
{
const auto parser = processor()->parser();
QTC_ASSERT(parser, return);
if (parser->projectPart() != projectPart || parser->configuration().editorDefines != defines) {
CppTools::BaseEditorDocumentParser::Configuration config = parser->configuration();
config.manuallySetProjectPart = projectPart;
config.editorDefines = defines;
parser->setConfiguration(config);
emit preprocessorSettingsChanged(!defines.trimmed().isEmpty());
}
}
开发者ID:acacid,项目名称:qt-creator,代码行数:14,代码来源:cppeditordocument.cpp
示例8: loadOption
void loadOption(HWND nppHandle, StruOptions& struOptions)
{
loadDefaultOption(struOptions);
tstring tsConfigFilePath = GetConfigFilePath(nppHandle);
IniFileProcessor processor(tsConfigFilePath);
IniFileProcessor::IniMap map;
map = processor.GetInfo(true);
IniFileProcessor::IniMap::iterator itrEnd = map.end();
if(map.find(keyPutCR) != itrEnd)
{
if(!map[keyPutCR].GetStrValue().compare("0"))
struOptions.bPutCR = false;
}
if(map.find(keyChIndent) != itrEnd)
{
string strIndent = map[keyChIndent].GetStrValue();
if(!strIndent.compare("tab"))
struOptions.chIndent = '\t';
else if(!strIndent.compare("space"))
struOptions.chIndent = ' ';
}
if(map.find(keyChPerInd) != itrEnd)
{
struOptions.nChPerInd = atoi(map[keyChPerInd].GetStrValue().c_str());
}
if(map.find(keyNLBracket) != itrEnd)
{
if(!map[keyNLBracket].GetStrValue().compare("1"))
struOptions.bNLBracket = true;
}
if(map.find(keyKeepTopComt) != itrEnd)
{
if(!map[keyKeepTopComt].GetStrValue().compare("1"))
struOptions.bKeepTopComt = true;
}
if(map.find(keyIndentInEmpty) != itrEnd)
{
if(!map[keyIndentInEmpty].GetStrValue().compare("1"))
struOptions.bIndentInEmpty = true;
}
}
开发者ID:Dj-Corps,项目名称:jstoolnpp,代码行数:49,代码来源:utility.cpp
示例9: analyze_binary_region
void analyze_binary_region(const RT::BinaryRegion& binaryRegion, std::set<RT::BinaryBlock*>& binaryBlocks) {
RT::RecursiveTraversalInstructionProcessor processor(
&binaryRegion, binaryRegion.baseAddress() + binaryRegion.entryPointOffset()
);
processor.setBinaryBlocks(&binaryBlocks);
// The current_memory_address should not be into any pre-existing binary block
if(is_address_within_blocks(processor.currentAddress(), binaryBlocks)) {
return;
}
processor.pushAddressToDisassemble(processor.currentAddress());
while(1) {
// Empty stack? End.
if(processor.addressesToDisassemble().empty()) {
break;
}
// Get last address to disassemble
processor.setCurrentAddressToDisassemble(processor.popLastAddressToDisassemble());
// if our address doesn't overlays any block and is within the binary region, keep disassembling
while(!is_address_within_blocks(processor.currentAddress(), binaryBlocks) &&
is_address_within_binary_region(binaryRegion,processor.currentAddress()))
{
RT::Instruction* inst = my_disass_function(binaryRegion, processor.currentAddress());
std::cout << "Current address: " << processor.currentAddress() << std::endl;
std::cout << "Length: " << inst->length() << std::endl;
// According to the instruction type, need to do something
inst->getExecuted(processor);
delete inst;
}
// Register the last block
processor.fillBinaryBlocks();
}
dump_binary_blocks(binaryBlocks);
}
开发者ID:Ge0,项目名称:RecursiveTraversalx86,代码行数:49,代码来源:region_split.cpp
示例10: ucs4_to_eightbit
char ucs4_to_eightbit(char_type ucs4, string const & encoding)
{
static map<string, IconvProcessor> processors;
map<string, IconvProcessor>::iterator it = processors.find(encoding);
if (it == processors.end()) {
IconvProcessor processor(encoding.c_str(), ucs4_codeset);
it = processors.insert(make_pair(encoding, processor)).first;
}
char out;
int const bytes = it->second.convert((char *)(&ucs4), 4, &out, 1);
if (bytes > 0)
return out;
return 0;
}
开发者ID:djmitche,项目名称:lyx,代码行数:15,代码来源:unicode.cpp
示例11: filemap
int
filemap(const char *name,
void (*processor)(const void *, size_t, const char *, void *arg),
void *arg)
{
size_t nbytes;
int fd;
int n;
struct stat sb;
void *p;
fd = open(name, O_RDONLY|O_BINARY);
if (fd < 0) {
perror(name);
return 0;
}
if (fstat(fd, &sb) < 0) {
perror(name);
return 0;
}
if (!S_ISREG(sb.st_mode)) {
fprintf(stderr, "%s: not a regular file\n", name);
return 0;
}
nbytes = sb.st_size;
p = malloc(nbytes);
if (!p) {
fprintf(stderr, "%s: out of memory\n", name);
return 0;
}
n = read(fd, p, nbytes);
if (n < 0) {
perror(name);
free(p);
close(fd);
return 0;
}
if (n != nbytes) {
fprintf(stderr, "%s: read unexpected number of bytes\n", name);
free(p);
close(fd);
return 0;
}
processor(p, nbytes, name, arg);
free(p);
close(fd);
return 1;
}
开发者ID:252525fb,项目名称:rpcs3,代码行数:48,代码来源:readfilemap.c
示例12: drawNodeStatus
void StarView::update(const Job &job)
{
if (job.state() == Job::WaitingForCS) {
drawNodeStatus();
return;
}
unsigned int hostid = processor(job);
if (!hostid)
return;
HostItem *hostItem = findHostItem(hostid);
if (!hostItem)
return;
hostItem->update(job);
bool finished = job.state() == Job::Finished || job.state() == Job::Failed;
QMap<unsigned int, HostItem *>::Iterator it;
it = m_jobMap.find(job.jobId());
if (it != m_jobMap.end()) {
(*it)->update(job);
if (finished) {
m_jobMap.erase(it);
unsigned int clientid = job.client();
HostItem *clientItem = findHostItem(clientid);
if (clientItem)
clientItem->setIsActiveClient(false);
}
drawNodeStatus();
return;
}
if (!finished)
m_jobMap.insert(job.jobId(), hostItem);
if (job.state() == Job::Compiling) {
unsigned int clientid = job.client();
HostItem *clientItem = findHostItem(clientid);
if (clientItem) {
clientItem->setClient(clientid);
clientItem->setIsActiveClient(true);
}
}
drawNodeStatus();
}
开发者ID:lizardo,项目名称:Iceberg,代码行数:48,代码来源:starview.cpp
示例13: computeRmdupHitsSerial
// Compute the hits for each read in the input file without threading
// Return the number of reads processed
size_t computeRmdupHitsSerial(const std::string& prefix, const std::string& readsFile,
const OverlapAlgorithm* pOverlapper, StringVector& filenameVec)
{
std::string filename = prefix + RMDUPHITS_EXT + GZIP_EXT;
filenameVec.push_back(filename);
RmdupProcess processor(filename, pOverlapper);
RmdupPostProcess postProcessor;
size_t numProcessed =
SequenceProcessFramework::processSequencesSerial<SequenceWorkItem,
OverlapResult,
RmdupProcess,
RmdupPostProcess>(readsFile, &processor, &postProcessor);
return numProcessed;
}
开发者ID:cboursnell,项目名称:sga,代码行数:18,代码来源:rmdup.cpp
示例14: profile
void profile() {
MapSafeVector loadedMaps;
RouteProcessor processor(&loadedMaps);
while(!feof(stdin)) {
char packinfo[Processor::c_maxPackInfo];
DataBuffer buf(4);
if ( fread( buf.getBufferAddress(), 4, 1, stdin) != 1 )
exit(0);
uint32 packSize = buf.readNextLong();
RequestPacket* packet = new RequestPacket(packSize+4);
if ( fread ( packet->getBuf(), packSize, 1, stdin ) != 1 )
exit(0);
processor.handleRequest(packet, packinfo);
}
exit(0);
}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:16,代码来源:RouteModule.cpp
示例15: StartEndpoints
virtual void StartEndpoints(const std::vector<EndpointDescription>& endpoints, OpcUa::Services::SharedPtr server) override
{
for (const EndpointDescription endpoint : endpoints)
{
const Common::Uri uri(endpoint.EndpointURL);
if (uri.Scheme() == "opc.tcp")
{
std::shared_ptr<IncomingConnectionProcessor> processor(new OpcTcp(server, Debug));
TcpParameters tcpParams;
tcpParams.Port = uri.Port();
if (Debug) std::clog << "opc_tcp_processor| Starting listen port " << tcpParams.Port << std::endl;
TcpAddon.Listen(tcpParams, processor);
Ports.push_back(tcpParams);
}
}
}
开发者ID:chenxinghua,项目名称:freeopcua,代码行数:16,代码来源:opcua_protocol_addon.cpp
示例16: computeHitsSerial
// Compute the hits for each read in the input file without threading
// Return the number of reads processed
size_t computeHitsSerial(const std::string& prefix, const std::string& readsFile,
const OverlapAlgorithm* pOverlapper, int minOverlap,
StringVector& filenameVec, std::ostream* pASQGWriter)
{
std::string filename = prefix + HITS_EXT + GZIP_EXT;
filenameVec.push_back(filename);
OverlapProcess processor(filename, pOverlapper, minOverlap);
OverlapPostProcess postProcessor(pASQGWriter, pOverlapper);
size_t numProcessed =
SequenceProcessFramework::processSequencesSerial<SequenceWorkItem,
OverlapResult,
OverlapProcess,
OverlapPostProcess>(readsFile, &processor, &postProcessor);
return numProcessed;
}
开发者ID:Bioinformaticsnl,项目名称:sga,代码行数:19,代码来源:overlap.cpp
示例17: ucs4_to_multibytes
void ucs4_to_multibytes(char_type ucs4, vector<char> & out,
string const & encoding)
{
static map<string, IconvProcessor> processors;
map<string, IconvProcessor>::iterator it = processors.find(encoding);
if (it == processors.end()) {
IconvProcessor processor(encoding.c_str(), ucs4_codeset);
it = processors.insert(make_pair(encoding, processor)).first;
}
out.resize(4);
int bytes = it->second.convert((char *)(&ucs4), 4, &out[0], 4);
if (bytes > 0)
out.resize(bytes);
else
out.clear();
}
开发者ID:djmitche,项目名称:lyx,代码行数:17,代码来源:unicode.cpp
示例18: computeGapArray
// Compute the gap array for the first n items in pReader
void computeGapArray(SeqReader* pReader, size_t n, const BWT* pBWT, bool doReverse, int numThreads, GapArray* pGapArray,
bool removeMode, size_t& num_strings_read, size_t& num_symbols_read)
{
// Create the gap array
size_t gap_array_size = pBWT->getBWLen() + 1;
pGapArray->resize(gap_array_size);
// The rank processor calculates the rank of every suffix of a given sequence
// and returns a vector of ranks. The postprocessor takes in the vector
// and updates the gap array
RankPostProcess postProcessor(pGapArray);
size_t numProcessed = 0;
if(numThreads <= 1)
{
RankProcess processor(pBWT, pGapArray, doReverse, removeMode);
numProcessed =
SequenceProcessFramework::processSequencesSerial<SequenceWorkItem,
RankResult,
RankProcess,
RankPostProcess>(*pReader, &processor, &postProcessor, n);
}
else
{
typedef std::vector<RankProcess*> RankProcessVector;
RankProcessVector rankProcVec;
for(int i = 0; i < numThreads; ++i)
{
RankProcess* pProcess = new RankProcess(pBWT, pGapArray, doReverse, removeMode);
rankProcVec.push_back(pProcess);
}
numProcessed =
SequenceProcessFramework::processSequencesParallel<SequenceWorkItem,
RankResult,
RankProcess,
RankPostProcess>(*pReader, rankProcVec, &postProcessor, n);
for(int i = 0; i < numThreads; ++i)
delete rankProcVec[i];
}
num_strings_read = postProcessor.getNumStringsProcessed();
num_symbols_read = postProcessor.getNumSymbolsProcessed();
assert(n == (size_t)-1 || (numProcessed == n));
}
开发者ID:Buttonwood,项目名称:sga,代码行数:47,代码来源:BWTDiskConstruction.cpp
示例19: interact
int SimpleCli::interact(int ch)
{
if ((ch == ARROW_UP) && (cursor == 0)) {
// execute last successful command
for(cursor = 0; ; cursor++) {
cmd[cursor] = hist[cursor];
if (cmd[cursor] == '\0')
break;
}
if (term) term->puts(cmd);
return 0;
}
if (ch == '\n' && *cmd) {
if (processor && (processor(cmd, term) == 0))
memcpy(hist, cmd, sizeof(cmd));
for(uint8_t i = 0; i < cursor; i++)
cmd[i] = '\0';
cursor = 0;
}
// backspace processing
if ((ch == '\b') || (ch == 127)) { // Backspace coded as 'Ctr+?' == 127
if (cursor) {
cursor--;
cmd[cursor] = '\0';
if (term) {
term->putch(' ');
term->putch('\b');
}
}
}
if (ch < ' ' || ch == 127)
return 0;
cmd[cursor++] = (uint8_t)ch;
cursor &= CMD_LEN;
// clean up in case of overflow (command too long)
if (!cursor) {
for(uint8_t i = 0; i <= CMD_LEN; i++)
cmd[i] = '\0';
}
return 0;
}
开发者ID:jaychhatpar,项目名称:Galileo,代码行数:46,代码来源:SimpleCli.cpp
示例20: NEX_ASSERT
// todo Optimize.
void Pass::View::UpdateParams(CommitContext& ctx, ParameterContext type,
uint32 id) {
NEX_ASSERT(this == ctx.pass);
ParameterGroupItem& item = paramGroupEntries[(uint32) type];
ctx.paramContext = CommitContext::ParamContext(
item.offsetInParamBuffer, ctx.paramBuffers[(uint32) type]);
for (auto it = item.beginIt; it != item.endIt; ++it) {
ParameterGroup* group = (*it).group;
NEX_ASSERT(group->context == type);
if (group->lastUpdateId == id) {
ctx.paramContext.first += group->size;
if (type == ParameterContext::CTX_OBJECT)
group->lastUpdateId = id;
continue;
}
ctx.paramGroup = group;
if (group->processor) {
ctx.groupDataPtr = nullptr;
group->Map(ctx.renderContext);
group->processor(ctx, group);
group->Unmap(ctx.renderContext);
} else {
ctx.groupDataPtr = group->Map(ctx.renderContext);
for (uint32 i = 0; i < group->numParams; ++i) {
ConstantParameter* parameter = group->GetParamByIndex(i);
NEX_ASSERT(parameter->processor);
parameter->processor(ctx, parameter);
}
group->Unmap(ctx.renderContext);
}
(*it)->lastUpdateId = id;
}
ctx.paramGroup = nullptr;
for (auto it = item.beginSamplerIt; it != item.endSamplerIt; it =
SamplerParameter::Next(it)) {
NEX_ASSERT(it->processor);
if (it->context == type)
it->processor(ctx, it);
}
}
开发者ID:obhi-d,项目名称:nextar,代码行数:45,代码来源:Pass.cpp
注:本文中的processor函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论