本文整理汇总了C++中set类的典型用法代码示例。如果您正苦于以下问题:C++ set类的具体用法?C++ set怎么用?C++ set使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了set类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insert_brkpt_batch
/**
* Inserts all the breakpoints, called after user provided 'continue' command
*
* @param pid: Process ID of the child (debuggee)
*/
void insert_brkpt_batch( pid_t pid ) {
for ( auto it = brkpt_batch.begin(); it != brkpt_batch.end(); ) {
set_brkpt( pid, *it, true );
brkpt_batch.erase( it++ /* makes a copy and destroys current it */ );
}
}
示例2: localAvailableSpecsWithout
int PolySolverNAD::FindBestSolution(SADNADGraph &graph, vector<pair<Node*, Node*> > availableSpecs, set<pair<Node*, Node*> > chosenSpecs, int verbose)
{
if (availableSpecs.size() == 0)
{
//return the # of AD components
int nb = graph.GetNbADComponents(chosenSpecs) - 1;
if (verbose > 0)
{
cout<<" RETURNING "<<nb<<endl;
}
if (nb < bestSolSoFar)
{
bestSolSoFar = nb;
bestChoiceSoFar = chosenSpecs;
}
return nb;
}
int bestWith = 0;
int bestWithout = 0;
//2 cases : next available spec is chosen, or not
//EASY CASE : NOT CHOSEN
vector<pair<Node*, Node*> > localAvailableSpecsWithout(availableSpecs);
localAvailableSpecsWithout.erase(localAvailableSpecsWithout.begin());
bestWithout = FindBestSolution(graph, localAvailableSpecsWithout, chosenSpecs, verbose);
//TOUGH CASE : IT'S CHOSEN. Then update what's available or not, and chosen or not
set<pair<Node*, Node*> > localChosen(chosenSpecs);
pair<Node*, Node*> nextSpec = availableSpecs[0];
vector<pair<Node*, Node*> > localAvailableSpecs(availableSpecs);
localChosen.insert(nextSpec);
localAvailableSpecs.erase(localAvailableSpecs.begin());
if (verbose > 0)
{
cout<<endl<<"CHOOSING AN EDGE "<<endl<<"AVAIL="<<availableSpecs.size()<<" CHOSEN="<<chosenSpecs.size();
cout<<" Choice="<<nextSpec.first->GetLabel()<<" "<<nextSpec.second->GetLabel();
for (vector<pair<Node*, Node*> >::iterator vit = availableSpecs.begin(); vit != availableSpecs.end(); vit++)
{
cout<<(*vit).first->GetLabel()<<" "<<(*vit).second->GetLabel()<<endl;
}
cout<<"CHOSEN="<<endl;
for (set<pair<Node*, Node*> >::iterator vit = chosenSpecs.begin(); vit != chosenSpecs.end(); vit++)
{
cout<<(*vit).first->GetLabel()<<" "<<(*vit).second->GetLabel()<<endl;
}
}
//automatically include every spec in the same clique as nextSpec
//what nextSpec does is that it "combines" two cliques
//first, get the 2 cliques the nextSpec vertices are in
Node* v1 = nextSpec.first;
Node* v2 = nextSpec.second;
set<Node*> cliqueV1;
cliqueV1.insert(v1);
set<Node*> cliqueV2;
cliqueV2.insert(v2);
for (set<pair<Node*, Node*> >::iterator it = localChosen.begin(); it != localChosen.end(); it++)
{
pair<Node*, Node*> e = (*it);
if (e != nextSpec)
{
if (e.first == v1)
cliqueV1.insert(e.second);
if (e.second == v1)
cliqueV1.insert(e.first);
if (e.first == v2)
cliqueV2.insert(e.second);
if (e.second == v2)
cliqueV2.insert(e.first);
}
}
//now, each cliqueV1 and cliqueV2 should be complete to eachother (otherwise this code is not working)
//The spec edges that link these 2 cliques are chosen "by default", so no need to make them available
vector<pair<Node*, Node*> >::iterator avit = localAvailableSpecs.begin();
while (avit != localAvailableSpecs.end())
{
pair<Node*, Node*> e = (*avit);
//NOTE : next spec shouldn't be in localAvailableSpecs
if ((cliqueV1.find(e.first) != cliqueV1.end() && cliqueV2.find(e.second) != cliqueV2.end()) ||
(cliqueV2.find(e.first) != cliqueV2.end() && cliqueV1.find(e.second) != cliqueV1.end()))
//.........这里部分代码省略.........
示例3: stoi
namespace v81c { namespace xml {
namespace patch {
// В сигвинѣ нѣт std::stoi
static
int stoi(const string &s)
{
int r;
sscanf(s.c_str(), "%d", &r);
return r;
}
}
v8::String &__read(v8::String &dst, xmlpp::Node *element)
{
const xmlpp::Node::NodeList children = element->get_children(); // совместимость с libxml++ < 2.36
if (!children.empty()) {
const xmlpp::Node *text = children.front();
const xmlpp::TextNode *tn = dynamic_cast<const xmlpp::TextNode *>(text);
string sc(tn->get_content().c_str());
dst = v8::String(sc);
} else
dst = v8::String();
return dst;
}
v8::StringInLanguage &__read(v8::StringInLanguage &dst, xmlpp::Node *element)
{
v8::String lang;
v8::String content;
xmlpp::Node::PrefixNsMap ns;
ns["xmlns"] = v8::xmlns;
xmlpp::NodeSet nodes;
nodes = element->find("xmlns:lang", ns);
if (!nodes.empty()) {
dst.setLang(__read(lang, nodes.at(0)));
}
nodes = element->find("xmlns:content", ns);
if (!nodes.empty()) {
dst.setContent(__read(content, nodes.at(0)));
}
return dst;
}
v8::StringInDifferentLanguages &
__read(v8::StringInDifferentLanguages &dst, xmlpp::Node *element)
{
xmlpp::Node::PrefixNsMap ns;
ns["xmlns"] = v8::xmlns;
xmlpp::NodeSet nodes;
nodes = element->find("xmlns:item", ns);
dst.clear();
for (auto node : nodes) {
v8::StringInLanguage item;
dst.push_back(__read(item, node));
}
return dst;
}
v8::Boolean &
__read(v8::Boolean &dst, xmlpp::Node *element)
{
dst.setValue(false);
const xmlpp::Node::NodeList children = element->get_children(); // совместимость с libxml++ < 2.36
if (!children.empty()) {
const xmlpp::Node *text = children.front();
const xmlpp::TextNode *tn = dynamic_cast<const xmlpp::TextNode *>(text);
string sc(tn->get_content().c_str());
if (sc == "true")
dst.setValue(true);
}
return dst;
}
v8::Number &
__read(v8::Number &dst, xmlpp::Node *element)
{
const xmlpp::Node::NodeList children = element->get_children(); // совместимость с libxml++ < 2.36
if (!children.empty()) {
//.........这里部分代码省略.........
示例4: InstrumentCalls
static void InstrumentCalls (BPatch_image *appImage, BPatch_addressSpace *appProcess,
ApplicationType *appType, set<string> &OMPset, set<string> &USERset,
map<string, vector<string> > & LoopLevels,
bool instrumentMPI, bool instrumentOMP, bool instrumentUF)
{
unsigned i = 0;
unsigned OMPinsertion = 0;
unsigned OMPreplacement_intel_v11 = 0;
unsigned MPIinsertion = 0;
unsigned APIinsertion = 0;
unsigned UFinsertion = 0;
const char *PMPI_C_prefix = "PMPI_";
const char *PMPI_F_prefix = "pmpi_";
const char *MPI_C_prefix = "MPI_";
const char *MPI_F_prefix= "mpi_";
cout << PACKAGE_NAME << ": Obtaining functions from application image (this may take a while)..." << flush;
BPatch_Vector<BPatch_function *> *vfunctions = appImage->getProcedures (false);
cout << "Done" << endl;
set<string> CUDAkernels;
/* Look for CUDA kernels if the application is CUDA */
if (appType->get_isCUDA())
{
cout << PACKAGE_NAME << ": Looking for CUDA kernels inside binary (this may take a while)..." << endl;
i = 0;
while (i < vfunctions->size())
{
char name[1024];
BPatch_function *f = (*vfunctions)[i];
f->getName (name, sizeof(name));
BPatch_Vector<BPatch_point *> *vpoints = f->findPoint (BPatch_subroutine);
if (vpoints != NULL)
{
unsigned j = 0;
while (j < vpoints->size())
{
BPatch_function *called = ((*vpoints)[j])->getCalledFunction();
if (NULL != called)
{
char calledname[1024];
called->getName (calledname, 1024);
if (strncmp (calledname, "__device_stub__", strlen("__device_stub__")) == 0)
{
CUDAkernels.insert (name);
if (VerboseLevel)
cout << PACKAGE_NAME << ": Found kernel " << name << endl;
}
}
j++;
}
}
i++;
}
cout << PACKAGE_NAME << ": Finished looking for CUDA kernels" << endl;
}
cout << PACKAGE_NAME << ": Parsing executable looking for instrumentation points (" << vfunctions->size() << ") ";
if (VerboseLevel)
cout << endl;
else
cout << flush;
/*
The 1st step includes:
a) gather information of openmp outlined routines (original is added to USERset),
b) instrument openmp outlined routines
c) instrument mpi calls
d) instrument api calls
*/
i = 0;
while (i < vfunctions->size())
{
char name[1024], sharedlibname_c[1024];
BPatch_function *f = (*vfunctions)[i];
(f->getModule())->getFullName (sharedlibname_c, sizeof(sharedlibname_c));
f->getName (name, sizeof(name));
string sharedlibname = sharedlibname_c;
string sharedlibname_ext;
if (sharedlibname.rfind('.') != string::npos)
sharedlibname_ext = sharedlibname.substr (sharedlibname.rfind('.'));
else
sharedlibname_ext = "";
/* For OpenMP apps, if the application has been linked with Extrae, just need to
instrument the function calls that have #pragma omp in them. The outlined
routines will be instrumented by the library attached to the binary */
if (!BinaryLinkedWithInstrumentation &&
instrumentOMP && appType->get_isOpenMP() && loadedModule != sharedlibname)
{
/* OpenMP instrumentation (just for OpenMP apps) */
//.........这里部分代码省略.........
示例5: initialize_exclusion_set
void initialize_exclusion_set( set<string> &exs){
static string _exclude[6] = {"a","an","the","but","or","and"};
exs.insert(_exclude,_exclude+6);
}
示例6: StoreInst
void WorklessInstrument::InstrumentWorkless0Or1Star(Module * pModule, Loop * pLoop, set<string> & setWorkingBlocks)
{
LoadInst * pLoad0 = NULL;
LoadInst * pLoad1 = NULL;
//BinaryOperator* pAdd = NULL;
StoreInst * pStore = NULL;
CallInst * pCall = NULL;
Function * pMain = NULL;
if(strMainName != "" )
{
pMain = pModule->getFunction(strMainName.c_str());
}
else
{
pMain = pModule->getFunction("main");
}
for (Function::iterator BB = pMain->begin(); BB != pMain->end(); ++BB)
{
if(BB->getName().equals("entry"))
{
CallInst * pCall;
StoreInst * pStore;
Instruction * II = BB->begin();
pCall = CallInst::Create(this->InitHooks, "", II);
pCall->setCallingConv(CallingConv::C);
pCall->setTailCall(false);
AttributeSet emptySet;
pCall->setAttributes(emptySet);
pCall = CallInst::Create(this->getenv, this->SAMPLE_RATE_ptr, "", II);
pCall->setCallingConv(CallingConv::C);
pCall->setTailCall(false);
AttributeSet AS;
{
SmallVector<AttributeSet, 4> Attrs;
AttributeSet PAS;
{
AttrBuilder B;
B.addAttribute(Attribute::NoUnwind);
PAS = AttributeSet::get(pModule->getContext(), ~0U, B);
}
Attrs.push_back(PAS);
AS = AttributeSet::get(pModule->getContext(), Attrs);
}
pCall->setAttributes(AS);
pCall = CallInst::Create(this->function_atoi, pCall, "", II);
pCall->setCallingConv(CallingConv::C);
pCall->setTailCall(false);
{
SmallVector<AttributeSet, 4> Attrs;
AttributeSet PAS;
{
AttrBuilder B;
B.addAttribute(Attribute::NoUnwind);
B.addAttribute(Attribute::ReadOnly);
PAS = AttributeSet::get(pModule->getContext(), ~0U, B);
}
Attrs.push_back(PAS);
AS = AttributeSet::get(pModule->getContext(), Attrs);
}
pCall->setAttributes(AS);
pStore = new StoreInst(pCall, this->SAMPLE_RATE, false, II);
pStore->setAlignment(4);
pCall = CallInst::Create(this->geo, pCall, "", II);
pCall->setCallingConv(CallingConv::C);
pCall->setTailCall(false);
pCall->setAttributes(emptySet);
CastInst * pCast = CastInst::CreateIntegerCast(pCall, this->LongType, true, "", II);
pStore = new StoreInst(pCast, this->CURRENT_SAMPLE, false, II);
pStore->setAlignment(8);
vector<Value *> vecParam;
vecParam.push_back(this->Output_Format_String);
vecParam.push_back(pCall);
pCall = CallInst::Create(this->printf, vecParam, "", II);
pCall->setCallingConv(CallingConv::C);
pCall->setTailCall(false);
pCall->setAttributes(emptySet);
break;
}
}
for (Function::iterator BB = pMain->begin(); BB != pMain->end(); ++BB)
{
for (BasicBlock::iterator Ins = BB->begin(); Ins != BB->end(); ++Ins)
{
if (isa<ReturnInst>(Ins) || isa<ResumeInst>(Ins))
{
vector<Value*> vecParams;
pLoad0 = new LoadInst(numIterations, "", false, Ins);
//.........这里部分代码省略.........
示例7: Get_END_Boundary_Range_For_START
void CDetCandit::Creating_DismCase_Cases(const char* inputchar, size_t i, size_t SENID, size_t& CASID, set<size_t>& START_s, set<size_t>& END_s, map<size_t, double>& START_Rtn_map,
map<size_t, double>& END_Rtn_map, map<size_t, set<size_t>>& pmSavedPair, map<size_t, map<size_t, ACE_entity_mention*>>& EntityMention_mm, vector<CanditCase*>& pmCandit_v)
{
size_t length = NLPOP::Get_Chinese_Sentence_Length_Counter(inputchar);
if((START_s.find(i) != START_s.end()) && START_Feedback_Ref_Flag){
multimap<double, size_t> FeedbackCase_mm;
if(!Greedy_Matching_Method_FLag){
size_t FeedBorder = Get_END_Boundary_Range_For_START(START_s, END_s, i, length);
for(size_t j = i; j <= FeedBorder; j++){//:* <? <=?
if(END_Rtn_map.find(j) == END_Rtn_map.end()){//decreasing performance...
continue;
}
if(END_s.find(j) != END_s.end()){
FeedbackCase_mm.insert(make_pair(2, j));
}
else if(END_Rtn_map[j] > FEEDBACE_PRO_LIMIT){
FeedbackCase_mm.insert(make_pair(END_Rtn_map[j], j));
}
}
}
else{
//AppCall::Secretary_Message_Box("Can not be use yet! in CDetCandit::Creating_DismCase_Cases()", MB_OK);
}
Erasing_Prescribed_Candidates(FeedbackCase_mm);
for(multimap<double, size_t>::iterator mmite = FeedbackCase_mm.begin(); mmite != FeedbackCase_mm.end(); mmite++){
if(Exist_Detection_and_Updata(pmSavedPair, i, mmite->second)){
continue;
}
pCanditCase ploc_Candit = new CanditCase;
ploc_Candit->SENID = SENID;
ploc_Candit->CASID = CASID++;
ploc_Candit->CEDT_Head_Flag = CEDT_Head_Flag;
// ploc_Candit->Detection_Flag = CEDT_Detection_Flag;
ploc_Candit->START = i;
ploc_Candit->END = mmite->second;
int Left_Out_Range = Get_Left_Outer_Feature_Range_For_START(START_s, END_s, ploc_Candit->START, -1);
int Right_Out_Range = Get_Right_Outer_Feature_Range_For_END(START_s, END_s, ploc_Candit->END, length-1);
ploc_Candit->l_outmstr = Sentop::Get_Substr_by_Chinese_Character_Cnt(inputchar, Left_Out_Range+1, ploc_Candit->START-Left_Out_Range-1);
ploc_Candit->r_outmstr = Sentop::Get_Substr_by_Chinese_Character_Cnt(inputchar, ploc_Candit->END+1, Right_Out_Range-ploc_Candit->END-1);
ploc_Candit->prix = Sentop::Get_Substr_by_Chinese_Character_Cnt(inputchar, 0, ploc_Candit->START);
ploc_Candit->prox = Sentop::Get_Substr_by_Chinese_Character_Cnt(inputchar, ploc_Candit->END+1, -1);
ploc_Candit->mention = Sentop::Get_Substr_by_Chinese_Character_Cnt(inputchar, ploc_Candit->START, ploc_Candit->END-ploc_Candit->START+1);
ploc_Candit->Cand_Flag = false;
ploc_Candit->pNE_mention = NULL;
ploc_Candit->predit_TYPE = (Detect_Single_NE_TYPE.length()==0)?POSITIVE:Detect_Single_NE_TYPE;
ploc_Candit->org_TYPE = NEGETIVE;
if(EntityMention_mm.find(ploc_Candit->START) != EntityMention_mm.end()){
if(EntityMention_mm[ploc_Candit->START].find(ploc_Candit->END) != EntityMention_mm[ploc_Candit->START].end()){
ploc_Candit->Cand_Flag = true;
ploc_Candit->pNE_mention = EntityMention_mm[ploc_Candit->START][ploc_Candit->END];
ploc_Candit->org_TYPE = CEDT_Detection_Flag?POSITIVE:EntityMention_mm[ploc_Candit->START][ploc_Candit->END]->Entity_TYPE;
}
}
pmCandit_v.push_back(ploc_Candit);
}
}
if((END_s.find(i) != END_s.end()) && END_Feedback_Ref_Flag){
multimap<double, size_t> FeedbackCase_mm;
if(!Greedy_Matching_Method_FLag){
int FeedBorder = Get_START_Boundary_Range_For_END(START_s, END_s, i, 0);
for(int j = i; j >= FeedBorder; j--){
if(START_Rtn_map.find(j) == START_Rtn_map.end()){
continue;
}
if(START_s.find(j) != START_s.end()){
FeedbackCase_mm.insert(make_pair(2, j));
}
else if(START_Rtn_map[j] > FEEDBACE_PRO_LIMIT){
FeedbackCase_mm.insert(make_pair(START_Rtn_map[j], j));
}
}
}
else{
set<size_t> matched_s;
Greedy_Right_to_Left_matching(START_s, END_s, i, 0, 2, matched_s);
//Greedy_Left_to_Right_matching(START_s, END_s, i, length-1, 2, matched_s);
for(set<size_t>::iterator site = matched_s.begin(); site != matched_s.end(); site++){
if(START_Rtn_map.find(*site) == START_Rtn_map.end()){
continue;
}
else{
FeedbackCase_mm.insert(make_pair(START_Rtn_map[*site], *site));
}
}
}
Erasing_Prescribed_Candidates(FeedbackCase_mm);
for(multimap<double, size_t>::iterator mmite = FeedbackCase_mm.begin(); mmite != FeedbackCase_mm.end(); mmite++){
if(Exist_Detection_and_Updata(pmSavedPair, mmite->second, i)){
continue;
}
pCanditCase ploc_Candit = new CanditCase;
ploc_Candit->SENID = SENID;
ploc_Candit->CASID = CASID++;
ploc_Candit->CEDT_Head_Flag = CEDT_Head_Flag;
//.........这里部分代码省略.........
示例8: while
void WorklessInstrument::CloneInnerLoop(Loop * pLoop, vector<BasicBlock *> & vecAdd, ValueToValueMapTy & VMap, set<BasicBlock *> & setCloned)
{
Function * pFunction = pLoop->getHeader()->getParent();
BasicBlock * pPreHeader = vecAdd[0];
SmallVector<BasicBlock *, 4> ExitBlocks;
pLoop->getExitBlocks(ExitBlocks);
set<BasicBlock *> setExitBlocks;
for(unsigned long i = 0; i < ExitBlocks.size(); i++)
{
setExitBlocks.insert(ExitBlocks[i]);
}
for(unsigned long i = 0; i < ExitBlocks.size(); i++ )
{
VMap[ExitBlocks[i]] = ExitBlocks[i];
}
vector<BasicBlock *> ToClone;
vector<BasicBlock *> BeenCloned;
//clone loop
ToClone.push_back(pLoop->getHeader());
while(ToClone.size()>0)
{
BasicBlock * pCurrent = ToClone.back();
ToClone.pop_back();
WeakVH & BBEntry = VMap[pCurrent];
if (BBEntry)
{
continue;
}
BasicBlock * NewBB;
BBEntry = NewBB = BasicBlock::Create(pCurrent->getContext(), "", pFunction);
if(pCurrent->hasName())
{
NewBB->setName(pCurrent->getName() + ".CPI");
}
if(pCurrent->hasAddressTaken())
{
errs() << "hasAddressTaken branch\n" ;
exit(0);
}
for(BasicBlock::const_iterator II = pCurrent->begin(); II != pCurrent->end(); ++II )
{
Instruction * NewInst = II->clone();
if(II->hasName())
{
NewInst->setName(II->getName() + ".CPI");
}
VMap[II] = NewInst;
NewBB->getInstList().push_back(NewInst);
}
const TerminatorInst *TI = pCurrent->getTerminator();
for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i)
{
ToClone.push_back(TI->getSuccessor(i));
}
setCloned.insert(NewBB);
BeenCloned.push_back(NewBB);
}
//remap value used inside loop
vector<BasicBlock *>::iterator itVecBegin = BeenCloned.begin();
vector<BasicBlock *>::iterator itVecEnd = BeenCloned.end();
for(; itVecBegin != itVecEnd; itVecBegin ++)
{
for(BasicBlock::iterator II = (*itVecBegin)->begin(); II != (*itVecBegin)->end(); II ++ )
{
//II->dump();
RemapInstruction(II, VMap);
}
}
//add to the else if body
BasicBlock * pElseBody = vecAdd[1];
BasicBlock * pClonedHeader = cast<BasicBlock>(VMap[pLoop->getHeader()]);
BranchInst::Create(pClonedHeader, pElseBody);
//errs() << pPreHeader->getName() << "\n";
for(BasicBlock::iterator II = pClonedHeader->begin(); II != pClonedHeader->end(); II ++ )
{
if(PHINode * pPHI = dyn_cast<PHINode>(II))
{
vector<int> vecToRemoved;
for (unsigned i = 0, e = pPHI->getNumIncomingValues(); i != e; ++i)
//.........这里部分代码省略.........
示例9: findUniqueWidgetTypes
void findUniqueWidgetTypes(fstream& stream, WidgetNode *root, set<string> &widgetTypes) {
if(root->widgetType!="Gui" && root->widgetType!="root")
widgetTypes.insert(root->widgetType);
for(size_t i = 0; i < root->children.size(); i++)
findUniqueWidgetTypes(stream, root->children[i], widgetTypes);
}
示例10: end
bool
TileMapLayerInfoVector::updateLayers( TileMapLayerInfoVector& clientVector,
const set<int>& existinLayers )
{
// The clientVector will be the target of this operation.
// Afterwards the vector is copied.
int changed = 0;
// Add changes from the client vector to our settings.
for( TileMapLayerInfoVector::iterator it = clientVector.begin();
it != clientVector.end();
++it ) {
TileMapLayerInfo* myInfo = NULL;
// Find the info from the server.
for ( TileMapLayerInfoVector::iterator jt = this->begin();
jt != this->end();
++jt ) {
if ( jt->getID() == it->getID() ) {
myInfo = &(*jt);
break;
}
}
changed += it->setPresent( myInfo &&
( existinLayers.find( it->getID() ) != existinLayers.end() ) );
if ( ! myInfo ) {
continue;
}
// These are always correct from the server by definition
changed += it->setOptional( myInfo->isOptional() );
changed += it->setAffectedByACPMode( myInfo->isAffectedByACPMode() );
changed += it->setFetchLayerWhenACPEnabled( myInfo->getFetchLayerWhenACPEnabled() );
changed += it->setFetchLayerWhenACPDisabled( myInfo->getFetchLayerWhenACPDisabled() );
// Non-optional layers can not be turned off.
if ( ! it->isOptional() ) {
changed += it->setVisible( true );
}
if ( it->getServerOverrideNumber() !=
myInfo->getServerOverrideNumber() ) {
// Force the update into the vector.
changed +=
it->setUpdatePeriodMinutes( myInfo->getUpdatePeriodMinutes() );
changed += it->setVisible( myInfo->isVisible() );
// But only do it once.
it->setServerOverrideNumber( myInfo->getServerOverrideNumber() );
} else {
// Keep the info that the client entered
}
}
// Add layers to the vector that are not present yet.
for ( iterator jt = begin();
jt != end();
++jt ) {
bool found = false;
for ( iterator it = clientVector.begin();
it != clientVector.end();
++it ) {
if ( jt->getID() == it->getID() ) {
found = true;
break;
}
}
if ( ! found ) {
// Insert that into the client vector.
++changed;
clientVector.push_back( *jt );
}
}
// This vector will now be the same as the other one.
*this = clientVector;
return changed;
}
示例11: deleteMyself
void deleteMyself(set<Shape<int>* >& aSet)
{
aSet.erase(this);
cout << "Me: " << this->getName() << " is still in here" << endl;
}
示例12: getIntervals
vector<Interval> getIntervals() {
return vector<Interval>(interval.begin(), interval.end());
}
示例13: init_lookup_table
void init_lookup_table() { vis.clear(); }
示例14: f
void f(int b) {
q.clear();
BORDER = b;
dfs(0, 0);
}
示例15: visit
virtual void visit(SgNode* n) {nodes.insert(n);}