当前位置: 首页>>代码示例>>C++>>正文


C++ processor函数代码示例

本文整理汇总了C++中processor函数的典型用法代码示例。如果您正苦于以下问题:C++ processor函数的具体用法?C++ processor怎么用?C++ processor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了processor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的processor函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。