本文整理汇总了C++中cont函数的典型用法代码示例。如果您正苦于以下问题:C++ cont函数的具体用法?C++ cont怎么用?C++ cont使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cont函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: clone
bool
RealTrafficIPC::sendChangeset( const Disturbances& newElements,
const Disturbances& removedElements ) {
Disturbances newClonedElements;
Disturbances removedClonedElements;
clone( newElements, newClonedElements );
clone( removedElements, removedClonedElements );
DisturbanceChangeset changeset( newClonedElements, removedClonedElements );
// create the packet
DisturbanceChangesetRequestPacket* packet =
new DisturbanceChangesetRequestPacket( Packet::PacketID( 0 ),
m_moduleCom.getNextRequestID(),
changeset );
uint32 mapID = MAX_UINT32;
if ( ! newElements.empty() ) {
mapID = newElements.front()->getMapID();
} else if ( ! removedElements.empty() ) {
mapID = removedElements.front()->getMapID();
}
packet->setMapID( mapID );
// send the packet and get the packet container as a return.
auto_ptr<PacketContainer> cont( m_moduleCom.
putRequest( packet, MODULE_TYPE_TRAFFIC ) );
DisturbanceChangesetReplyPacket* answer;
if ( getValidPacket( answer, cont.get() ) ) {
if( answer && answer->getStatus() == StringTable::OK ) {
mc2dbg4 << "[RTIPC] send change set OK" << endl;
return true;
} else {
if ( answer->getUpdateStatus() == StringTable::NOTOK ) {
mc2log << warn
<< "[RTIPC] Failed to update new DisturbanceElements."
<< endl;
}
if ( answer->getRemoveStatus() == StringTable::NOTOK ) {
mc2log << warn
<< "[RTIPC] Failed to remove old DisturbanceElements."
<< endl;
}
}
}
return false;
}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:48,代码来源:RealTrafficIPC.cpp
示例17: stop
/*
This function tests, if there is an overflow at the clock counter
Function should be called at least every 30 min., if the cpu_time is stoped
Otherwise there might be more than one overflow and results are wrong!
*/
void CStopWatch::testOverflow()
{
if(m_iTimeType == util_CPU_TIME)
{
stop();
if (m_iLast < m_iFirst)
{
m_fOverflowTime += (double(m_iLast - m_iFirst + ULONG_MAX)) / CLOCKS_PER_SEC;
start();
}
else
cont();
}
else
warning("testOverflow() : overflow has to be tested only when measuring cpu-time");
};
开发者ID:beds-beisheng,项目名称:schunk_modular_robotics,代码行数:21,代码来源:StopWatch.cpp
示例18: throw
/*!
* @if jp
* @brief NamingContext を再帰的に下って非アクティブ化する
* @else
* @brief Destroy the naming context recursively
* @endif
*/
void CorbaNaming::destroyRecursive(CosNaming::NamingContext_ptr context)
throw (SystemException, NotEmpty, NotFound, CannotProceed, InvalidName)
{
CosNaming::BindingList_var bl;
CosNaming::BindingIterator_var bi;
CORBA::Boolean cont(true);
#ifndef ORB_IS_RTORB
context->list(m_blLength, bl.out(), bi.out());
#else // ORB_IS_RTORB
// context->list(m_blLength, bl, bi);
context->list(m_blLength, (CosNaming::BindingList_out)bl,
(CosNaming::BindingIterator_ptr)bi);
#endif // ORB_IS_RTORB
while (cont)
{
CORBA::ULong len(bl->length());
for (CORBA::ULong i = 0; i < len; ++i)
{
if (bl[i].binding_type == CosNaming::ncontext)
{ // If Object is context, destroy recursive.
CosNaming::NamingContext_var next_context;
next_context = CosNaming::NamingContext::
_narrow(context->resolve(bl[i].binding_name));
// Recursive function call
destroyRecursive(next_context); // +++ Recursive call +++
context->unbind(bl[i].binding_name);
next_context->destroy();
}
else if (bl[i].binding_type == CosNaming::nobject)
{ // If Object is object, unbind it.
context->unbind(bl[i].binding_name);
}
else assert(0); // never comes here
}
// no more binding -> do-while loop will be finished
if (CORBA::is_nil(bi)) cont = false;
else bi->next_n(m_blLength, bl);
}
if (!CORBA::is_nil(bi)) bi->destroy();
return;
}
开发者ID:pansas,项目名称:OpenRTM-aist-portable,代码行数:54,代码来源:CorbaNaming.cpp
示例19: main
int main (int argc, char **argv)
{
EDAMetasearchStart (argc, argv);
if (argc != 2)
{
std::cerr << "Usage : ./" << __progname
<< " [instance]" << std::endl;
}
else
{
Graph graph(argv[1]);
edaSolutionList list;
for(unsigned int i = 0; i < 40; i++) {
tspSolution *route = new tspSolution (graph);
route->init();
list.push_back(route);
}
tspTwoOpt two_opt (graph);
tspTwoOptNext two_opt_next (graph);
edaFirstImprSelect moveSelect;
edaGenContinue cont(1500);
edaHC hcSearch (&two_opt, &two_opt_next, &moveSelect, &cont);
// Use the declaration below to run on single machine:
edaSeqWrapperControl sfControl;
sfControl.insertVertex (&hcSearch);
if (!sfControl.search (list))
{
cerr << "Error: Cannot execute search" << endl;
}
else
{
tspSolution route = *( (tspSolution*) list.getBest() );
cout << "[Route] " << route << endl;
cout << "[Fitness] " << route.evaluate () << endl;
// route.save("route.txt");
}
}
EDAMetasearchStop ();
return 0;
}
开发者ID:mohcicin,项目名称:metaheuristics,代码行数:46,代码来源:tspHCTwoOptSearch.cpp
示例20: apply_r_p
inline bool
apply_r_p(naming::address& addr, actions::continuation* c,
naming::id_type const& gid, threads::thread_priority priority)
{
typedef typename hpx::actions::extract_action<Action>::type action_type;
actions::continuation_type cont(c);
// If remote, create a new parcel to be sent to the destination
// Create a new parcel with the gid, action, and arguments
parcelset::parcel p (gid.get_gid(), complement_addr<action_type>(addr),
new hpx::actions::transfer_action<action_type>(priority), cont);
// Send the parcel through the parcel handler
hpx::applier::get_applier().get_parcel_handler().put_parcel(p);
return false; // destination is remote
}
开发者ID:NOMORECOFFEE,项目名称:hpx,代码行数:17,代码来源:apply.hpp
注:本文中的cont函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论