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


C++ cont函数代码示例

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


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

示例1: qDebug

void ZipInstaller::install()
{
    qDebug() << "[ZipInstall] initializing installation";

    runner = 0;
    connect(this, SIGNAL(cont()), this, SLOT(installContinue()));
    m_url = m_urllist.at(runner);
    m_logsection = m_loglist.at(runner);
    m_logver = m_verlist.at(runner);
    installStart();
}
开发者ID:victor2002,项目名称:rockbox_victor_clipplus,代码行数:11,代码来源:zipinstaller.cpp

示例2: future_cons

void future_cons(futures *fptr){
	int ans=-1,i;
	syscall arg;
	//for(i=0;i<4;i++){
		cont(fptr,prdata);
		if(arg!=-1 && ans!=-1){
			printf("the value produced %d\n",ans);
		//printf("the arg %d\n",arg);
	//}
		}
}
开发者ID:Khandelr,项目名称:Operating-System-Assignments,代码行数:11,代码来源:future_producer_consumer.c

示例3: buffer

// put contigs from contfile into contlist
void Contiglist::add_contigs( std::string contigsfiles ){
  std::stringstream ss;
  ss.str( contigsfiles );
  std::string filename;
  std::string buffer("");
  std::string line("");
  std::string contig_id("");

  while( getline( ss, filename, ',' )){
    Log::Inst()->log_it( "contigsfile: " + filename );

    // open contig file
    std::ifstream cont( filename );

    // read in contig objects
    while( getline( cont, line ) ){
      if( line[0] == '>' && buffer.length() != 0 ){
        if( buffer.length() > 2*initial_trim + contig_sub_len ){
          buffer = buffer.substr( initial_trim, buffer.length() - 2*initial_trim );
          contigs.push_back( Contig( reads, buffer, contig_id ));
          if( verbose ){
            Log::Inst()->log_it( "Added contig: " + contig_id );
          }
        }
        else if( buffer.length() > contig_sub_len ){
          int trim = (buffer.length() - contig_sub_len) / 2;
          buffer = buffer.substr( trim, buffer.length() - 2*trim );
          contigs.push_back( Contig( reads, buffer, contig_id ));
          if( verbose ){
            Log::Inst()->log_it( "Added contig: " + contig_id );
          }
        }

        buffer = "";
        contig_id = line.substr(1);
      }
      else if ( line[0] == '>' ){
        contig_id = line.substr(1);
      }
      else{
        buffer += line;
      }
    }

    // close contig file
    cont.close();
  }

  // insert last line into contigs list
  if( buffer.length() != 0 ){
    contigs.push_back( Contig( reads, buffer, contig_id ) );
  }
}
开发者ID:mrmckain,项目名称:Fast-Plast,代码行数:54,代码来源:contiglist.cpp

示例4: main

int main(){

	std::cout << "[t-moeoDMLSMonOp] => START" << std::endl;

	//init all components
	moeoUnboundedArchive<Solution> arch(false);
	eoTimeContinue<Solution> cont(1);
	fullEvalSolution fullEval(8);
	Solution s;
	evalSolution eval(8);
	ObjectiveVector o;
	SolNeighbor n;
	SolNeighborhood nh(8);
	moeoPLS1<SolNeighbor> pls1(cont, fullEval, arch, nh, eval);
	moeoExhaustiveUnvisitedSelect<Solution> select;
	moeoExhaustiveNeighborhoodExplorer<SolNeighbor> explorer(nh, eval);

	//Create a solution
	s.push_back(true);
	s.push_back(true);
	s.push_back(true);
	s.push_back(true);
	s.push_back(true);
	s.push_back(true);
	s.push_back(true);
	s.push_back(true);

	//Set its objective Vector
	o[0]=8;
	o[1]=0;
	s.objectiveVector(o);

	//test constructor 1 with a dmls and its archive
	moeoDMLSMonOp<SolNeighbor> test1(pls1, arch);

	//test constructor 2 with an incremental evaluation function, a selector and an explorer
	moeoDMLSMonOp<SolNeighbor> test2(fullEval, explorer, select, 2, true);

	//test constructor 3 with an incremental evaluation function, a selector and an explorer and the dmls archive
	moeoDMLSMonOp<SolNeighbor> test3(fullEval, arch, explorer, select, 2, true);

	std::cout << "initial solution:"  << std::endl;
	std::cout << s << std::endl;

	test1(s);

	std::cout << "mutate solution:"  << std::endl;
	std::cout << s << std::endl;

	std::cout << "[t-moeoDMLSMonOp] => OK" << std::endl;

	return EXIT_SUCCESS;
}
开发者ID:AdeleH,项目名称:paradiseo,代码行数:53,代码来源:t-moeoDMLSMonOp.cpp

示例5: character

/*
    Extract the next character.
    Returns: the character (between 0 and 1114111)
         or  UTF8_END   (the end)
         or  UTF8_ERROR (error)
*/
int utf8_decode_next() {
    int c;  /* the first byte of the character */
    int c1; /* the first continuation character */
    int c2; /* the second continuation character */
    int c3; /* the third continuation character */
    int r;  /* the result */

    if (the_index >= the_length) {
        return the_index == the_length ? UTF8_END : UTF8_ERROR;
    }
    the_byte = the_index;
    the_char += 1;
    c = get();
/*
    Zero continuation (0 to 127)
*/
    if ((c & 0x80) == 0) {
        return c;
    }
/*
    One continuation (128 to 2047)
*/
    if ((c & 0xE0) == 0xC0) {
        c1 = cont();
        if (c1 >= 0) {
            r = ((c & 0x1F) << 6) | c1;
            if (r >= 128) {
                return r;
            }
        }

/*
    Two continuations (2048 to 55295 and 57344 to 65535)
*/
    } else if ((c & 0xF0) == 0xE0) {
        c1 = cont();
        c2 = cont();
        if ((c1 | c2) >= 0) {
            r = ((c & 0x0F) << 12) | (c1 << 6) | c2;
            if (r >= 2048 && (r < 55296 || r > 57343)) {
                return r;
            }
        }

/*
    Three continuations (65536 to 1114111)
*/
    } else if ((c & 0xF8) == 0xF0) {
        c1 = cont();
        c2 = cont();
        c3 = cont();
        if ((c1 | c2 | c3) >= 0) {
            r = ((c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
            if (r >= 65536 && r <= 1114111) {
                return r;
            }
        }
    }
    return UTF8_ERROR;
}
开发者ID:gardners,项目名称:c65gs-font-rasteriser,代码行数:66,代码来源:utf8_decode.c

示例6: sizeof

void virtual_bidirectional_iteratorTest::testString()
{
	std::string source[100];
	std::string correct[100];
	std::string test[100];
	size_t num = sizeof(source) / sizeof(source[0]);
	for (size_t i = 0; i < num; ++i)
	{
		std::ostringstream ostr;
		ostr << "stringnumber:" << i;
		source[i] = ostr.str();
	}
	std::random_shuffle(source, source + num);
	{
		std::list<std::string> cont(source, source + num);
		std::reverse_copy(cont.begin(), cont.end(), correct);
		vrcopy(cont.begin(), cont.end(), test);
		CPPUNIT_ASSERT(std::equal(correct, correct + num, test));
	}
	{
		std::set<std::string> cont(source, source + num);
		std::reverse_copy(cont.begin(), cont.end(), correct);
		vrcopy(cont.begin(), cont.end(), test);
		CPPUNIT_ASSERT(std::equal(correct, correct + num, test));
	}
	{
		std::vector<std::string> cont(source, source + num);
		std::reverse_copy(cont.begin(), cont.end(), correct);
		vrcopy(cont.begin(), cont.end(), test);
		CPPUNIT_ASSERT(std::equal(correct, correct + num, test));
	}
	{
		std::string *cont = new std::string[num];
		std::copy(source, source + num, cont);
		std::reverse_copy(cont, cont + num, correct);
		vrcopy(cont, cont + num, test);
		CPPUNIT_ASSERT(std::equal(correct, correct + num, test));
		delete [] cont;
	}
}
开发者ID:data9824,项目名称:virtual_iterator,代码行数:40,代码来源:virtual_bidirectional_iteratorTest.cpp

示例7: main

int main(int argc, char **argv)
{
	context cont(width, height, "window");
	cont.attachArcBallCamera(glm::radians(45.0f), glm::vec3(4.0,4.0,3.0f));
	GLFWwindow *window = cont.getGLFWwindow();
	planeOBJ obj(0);
	cont.append_drawObj(&obj);

//	ShaderMan cubeShader("vs.glsl", "fs.glsl");
//	ShaderMan shadowShader("lightvs.glsl", "lightfs.glsl");
	cont.init();
	cont.run();
}
开发者ID:xeechou,项目名称:gltutorial,代码行数:13,代码来源:main.cpp

示例8: assert

  void CodeGen::fixupFrame(RegisterState* s) {
    // window size adjustment
    assert(haveStackFrame, "should have stack frame");
    fint stackTempCount = s->stackDepth + s->argDepth;
    if (stackTempCount & 1) ++stackTempCount;
    frameSize = stackTempCountToFrameSize(stackTempCount);
    assert((frameSize & (frame_word_alignment-1))  ==  0, "frame size must be even");

    a.Comment("patching stack frame creation code");
    // The mask in the inline cache marks the regs + the first ntemps stack locs.
    // If we have fewer than ntemps temps and have extra args, the bits for the
    // extra args must be set.
    // All stack locations beyond the first ntemps have to be cleared.
    
    fint ntemps = BitsPerWord - (NumInRegisters + NumLocalRegisters);
    if (stackTempCount - s->argDepth  <  ntemps   &&  s->argDepth > 0) {
      s->fixupMasks(stackTempCount);
    }
    a.saveExcursion(prologueAddr);
    if (stackTempCount <= ntemps && !s->argDepth) {
      // no need to init anything on the stack - just patch frameSize
      a.SaveI(SP, frameSize * -oopSize, SP);    // make new register window
      a.endExcursion();
    } else {
      // need to initialize extra stack locations and/or extra args
      Label* l = a.BraForward(true);
      DefinedLabel cont(a.printing);
      a.endExcursion();
      l->define();
      a.SaveI(SP, frameSize * -oopSize, SP);    // make new register window
      // clear locations beyond first ntemps 
      fint i;
      for ( i = max(ntemps, s->initStackTemps); 
            i < stackTempCount; 
            i++) {
        a.StoreI(FP, (local_slots_offset - i) * oopSize, G0);
      }
      // clear extra args marked "live" by fixupMasks
      // (necessary because the simple fixup scheme marks them as live
      // for the entire method, not only after they're used)
      for ( i = 1; 
            i <= s->argDepth; 
            i++) {
        fint bitNo = stackTempCount - i;
        if (bitNo < ntemps) {
          a.StoreI(FP, (local_slots_offset - bitNo) * oopSize, G0);
        }
      }
      a.Bra(&cont, true);
    }
  }
开发者ID:ardeujho,项目名称:self,代码行数:51,代码来源:codeGen_sparc.cpp

示例9: do_paused

void do_paused()
{
  enum user_commands cmd = get_command();
  
  switch(cmd) {
    case CMD_START:
  		cont();
      break;
  	case CMD_NEXT:
      stop();
  		next();
      break;
	}
}
开发者ID:DC-SWAT,项目名称:DreamShell,代码行数:14,代码来源:player.c

示例10: cont

void ScrollViewer::OnVerticalScroll(suic::ElementPtr eScroll, ScrollEventArg& scroll)
{
    suic::Int32 curpos = (int)_vScroll->GetScrollSize();

    suic::PanelPtr cont(GetContent());

    if (cont)
    {
        cont->SetVerticalOffset(curpos);

        cont->InvalidateArrange();
        cont->InvalidateVisual();
    }
}
开发者ID:tfzxyinhao,项目名称:sharpui,代码行数:14,代码来源:ScrollViewer.cpp

示例11: apply_l_p

        inline bool apply_l_p(actions::continuation* c,
            naming::address const& addr, threads::thread_priority priority)
        {
            typedef typename hpx::actions::extract_action<Action>::type action_type;

            BOOST_ASSERT(components::types_are_compatible(addr.type_,
                components::get_component_type<
                    typename action_type::component_type>()));

            actions::continuation_type cont(c);
            util::tuple<> env;
            apply_helper<action_type>::call(cont, addr.address_, priority, env);
            return true;     // no parcel has been sent (dest is local)
        }
开发者ID:NOMORECOFFEE,项目名称:hpx,代码行数:14,代码来源:apply.hpp

示例12: req

bool Client::handleMyShare() {
    //Reads a file, assumes filename given in data.filename, userId in data.user
    //Puts the data into a vector - kabir decides.
    cout << " #### bak1\n";
    std::string req(RETURN_ALL_SHARED);
    conn.writeToSocket((req));
    cout << " #### bak2\n";
    std::string conti;

    conn.readFromSocket(conti);
    cout << " #### bak3\n";
    conn.writeToSocket(data.filename);
    cout << " #### bak4\n";
    conn.readFromSocket(conti);
    cout << " #### bak5\n";
    conn.writeToSocket(data.user.userID);
    cout << " #### bak6\n";
    conn.readFromSocket(conti);
    cout << " #### bak7\n";

    string _tempfile = "HarmanDeclares.txt";
    cout << " #### bak8\n";
    conn.readFromSocket_file(_tempfile);
    cout << " #### bak9\n";
    std::string cont(CONTINUE);
    conn.writeToSocket(cont);
    //Harman processes filea nd puts it in place for kabir.

//    this->getServerFiles_login();
//    cout << " #### bak10\n";
//    this->dropboxpage->updateServerFiles();
//    cout << " #### bak11\n";
    string name;
    ifstream f;
    f.open(_tempfile);
    string trash;
    f >> trash; //Trash values.
    while(f) {
        f >> name;
        if (name=="") {
            //Dont add it.
        } else {
            this->dropboxpage->names.insert(name);
        }
    }
    cout << " #### bak12\n";
    f.close();

    return true;
}
开发者ID:harmankumar,项目名称:MyDropbox,代码行数:50,代码来源:share.cpp

示例13: main

    int main(void)
    {
        Container<3,int> cont(1,2,3);

        double sum = 0.0;
        cont.doOperation([&sum](int x, int y, int z)->void{
            sum += x;
            sum += y;
            sum += z;
        });

        std::cout << sum << std::endl;

        return 0;
    }
开发者ID:CCJY,项目名称:coliru,代码行数:15,代码来源:main.cpp

示例14: cont

void Widget::SetParent( Widget::Ptr parent ) {
	Container::Ptr  cont( std::dynamic_pointer_cast<Container>( parent ) );

	if( !cont ) {
		return;
	}

	Container::Ptr oldparent = m_parent.lock();

	if( oldparent ) {
		oldparent->Remove( shared_from_this() );
	}

	m_parent = cont;
}
开发者ID:Zykr,项目名称:SFGUI,代码行数:15,代码来源:Widget.cpp

示例15: character

/*
    Extract the next character.
    Returns: the character (between 0 and 1114111)
         or  UTF8_END   (the end)
         or  UTF8_ERROR (error)
*/
int 
utf8_decode_next(json_utf8_decode *utf8)
{
    int c;  /* the first byte of the character */
    int r;  /* the result */

    if (utf8->the_index >= utf8->the_length) {
        return utf8->the_index == utf8->the_length ? UTF8_END : UTF8_ERROR;
    }
    utf8->the_byte = utf8->the_index;
    utf8->the_char += 1;
    c = get(utf8);
/*
    Zero continuation (0 to 127)
*/
    if ((c & 0x80) == 0) {
        return c;
    }
/*
    One contination (128 to 2047)
*/
    if ((c & 0xE0) == 0xC0) {
        int c1 = cont(utf8);
        if (c1 < 0) {
            return UTF8_ERROR;
        }
        r = ((c & 0x1F) << 6) | c1;
        return r >= 128 ? r : UTF8_ERROR;
    }
/*
    Two continuation (2048 to 55295 and 57344 to 65535) 
*/
    if ((c & 0xF0) == 0xE0) {
        int c1 = cont(utf8);
        int c2 = cont(utf8);
        if (c1 < 0 || c2 < 0) {
            return UTF8_ERROR;
        }
        r = ((c & 0x0F) << 12) | (c1 << 6) | c2;
        return r >= 2048 && (r < 55296 || r > 57343) ? r : UTF8_ERROR;
    }
/*
    Three continuation (65536 to 1114111)
*/
    if ((c & 0xF1) == 0xF0) {
        int c1 = cont(utf8);
        int c2 = cont(utf8);
        int c3 = cont(utf8);
        if (c1 < 0 || c2 < 0 || c3 < 0) {
            return UTF8_ERROR;
        }
        r = ((c & 0x0F) << 18) | (c1 << 12) | (c2 << 6) | c3;
        return r >= 65536 && r <= 1114111 ? r : UTF8_ERROR;
    }
    return UTF8_ERROR;
}
开发者ID:charlien7,项目名称:Json_code,代码行数:62,代码来源:utf8_decode.c


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