本文整理汇总了C++中auto_vector类的典型用法代码示例。如果您正苦于以下问题:C++ auto_vector类的具体用法?C++ auto_vector怎么用?C++ auto_vector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了auto_vector类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: m
void Styler_Syntax::DoStyle(StyleRun& sr, unsigned int offset, const auto_vector<stxmatch>& matches) {
const unsigned int rstart = sr.GetRunStart();
const unsigned int rend = sr.GetRunEnd();
const unsigned int styleStart = offset < rstart ? rstart - offset : 0;
const stxmatch m(wxEmptyString, NULL, styleStart, 0, 0, 0, NULL);
if (matches.empty()) return;
auto_vector<stxmatch>::const_iterator p = lower_bound(matches.begin(), matches.end(), &m, stxmatch_start_less());
if (p != matches.begin()) --p;
for (; p != matches.end(); ++p) {
const unsigned int mStart = (*p)->start+offset;
const unsigned int mEnd = (*p)->end+offset;
if (mStart > rend) break;
// Check for overlap
if (mEnd > rstart && mStart < rend) {
const unsigned int start = wxMax(rstart, mStart);
const unsigned int end = wxMin(rend, mEnd);
const style* st = (*p)->st;
if (st) {
if (st->foregroundcolor != wxNullColour) sr.SetForegroundColor(start, end, st->foregroundcolor);
if (st->backgroundcolor != wxNullColour) {
sr.SetBackgroundColor(start, end, st->backgroundcolor);
if (mEnd > rend) sr.SetExtendBgColor(st->backgroundcolor);
}
if (st->fontflags != wxFONTFLAG_DEFAULT) sr.SetFontStyle(start, end, st->fontflags);
}
// Check if there are submatches
if ((*p)->subMatch.get()) {
DoStyle(sr, (*p)->start+offset, (*p)->subMatch->matches);
}
}
}
}
开发者ID:baguatuzi,项目名称:e,代码行数:39,代码来源:styler_syntax.cpp
示例2: addBlitterWidgets
void addBlitterWidgets(auto_vector<BlitterWidget> &blitters, VideoBufferLocker vbl) {
blitters.push_back(createX11Blitter(vbl).release());
blitters.push_back(createXvBlitter(vbl).release());
}
开发者ID:Jakz,项目名称:gambatte,代码行数:4,代码来源:addblitterwidgets_unix.cpp
示例3: addAudioEngines
void addAudioEngines(auto_vector<AudioEngine> &audioEngines, WId /*winId*/) {
audioEngines.push_back(new CoreAudioEngine);
// audioEngines.push_back(createOpenAlEngine().release());
}
开发者ID:Dabomstew,项目名称:gambatte-speedrun,代码行数:4,代码来源:addaudioengines_macx.cpp
示例4: addAudioEngines
void addAudioEngines(auto_vector<AudioEngine> &audioEngines, WId winId) {
if (WasapiEngine::isUsable())
audioEngines.push_back(new WasapiEngine);
audioEngines.push_back(new DirectSoundEngine(winId));
}
开发者ID:Dabomstew,项目名称:gambatte-speedrun,代码行数:6,代码来源:addaudioengines_win32.cpp
示例5: addAudioEngines
void addAudioEngines(auto_vector<AudioEngine> &audioEngines, WId /*winId*/) {
audioEngines.push_back(new AlsaEngine);
audioEngines.push_back(new OssEngine);
}
开发者ID:CatalystG,项目名称:gambatte-libretro,代码行数:4,代码来源:addaudioengines_linux.cpp
示例6: nest
bool
ChemistryMulti::check (const Scope& scope, const Geometry& geo,
const Soil& soil, const SoilWater& soil_water,
const SoilHeat& soil_heat, const Chemistry& chemistry,
Treelog& msg) const
{
bool ok = true;
for (size_t c = 0; c < combine.size (); c++)
{
Treelog::Open nest (msg, "Chemistry: '" + combine[c]->objid + "'");
if (!combine[c]->check (scope, geo, soil, soil_water, soil_heat,
chemistry, msg))
ok = false;
}
// Check for duplicate chemicals.
std::map<symbol, size_t> found;
for (size_t i = 0; i < chemicals.size (); i++)
{
const symbol type = chemicals[i]->objid;
std::map<symbol, size_t>::const_iterator f = found.find (type);
if (f != found.end ())
{
std::ostringstream tmp;
tmp << "Chemical '" << type << "' definded in multiple chemistries:";
for (size_t j = 0; j < combine.size (); j++)
if (combine[j]->know (type))
tmp << " '" << combine[j]->objid << "'";
msg.error (tmp.str ());
ok = false;
}
found[type] = i;
}
return ok;
}
开发者ID:perabrahamsen,项目名称:daisy-model,代码行数:35,代码来源:chemistry_multi.C
示例7: has_attribute
bool has_attribute (const symbol name) const
{
bool missing = false;
for (size_t i = 0; i < layers.size (); i++)
if (!layers[i]->horizon->has_attribute (name))
missing = true;
for (size_t i = 0; i < zones.size (); i++)
if (!zones[i]->horizon->has_attribute (name))
missing = true;
return !missing;
}
开发者ID:pamoakoy,项目名称:daisy-model,代码行数:11,代码来源:soil.C
示例8: output
void ErrorEstimatorImpl::output(std::ostream& os) const
{
os << "[ErrorEstimator] iterations:" << iterationCount_ <<
" error:" << error_ << endl;
for (int i=0; i<(int)massSpreads_.size(); i++)
os << " " << *massSpreads_[i] << endl;
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:7,代码来源:ErrorEstimator.cpp
示例9: massSpread
const MassSpread* ErrorEstimatorImpl::massSpread(int index) const
{
if (index < 0 || index >= (int)massSpreads_.size())
throw out_of_range("[ErrorEstimatorImpl::massSpread] Index out of range.");
return massSpreads_[index];
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:7,代码来源:ErrorEstimator.cpp
示例10:
void
ChemistryMulti::tick_top (const Units& units, const Geometry& geo,
const Soil& soil, const SoilWater& soil_water,
const SoilHeat& soil_heat,
const double tillage_age /* [d] */,
const Surface& surface,
const double snow_leak_rate, // [h^-1]
const double canopy_cover, // [],
const double canopy_leak_rate, // [h^-1]
const double litter_cover, // [],
const double litter_leak_rate, // [h^-1]
const double surface_runoff_rate /* [h^-1] */,
const double surface_water /* [mm] */,
const double total_rain /* [mm/h] */,
const double direct_rain, // [mm/h]
const double canopy_drip /* [mm/h] */,
const double h_veg /* [m] */,
Chemistry& chemistry,
const double dt, // [h]
Treelog& msg)
{
for (size_t c = 0; c < combine.size (); c++)
combine[c]->tick_top (units, geo, soil, soil_water, soil_heat,
tillage_age, surface,
snow_leak_rate, canopy_cover, canopy_leak_rate,
litter_cover, litter_leak_rate,
surface_runoff_rate, surface_water,
total_rain, direct_rain, canopy_drip, h_veg,
chemistry, dt, msg);
}
开发者ID:perabrahamsen,项目名称:daisy-model,代码行数:30,代码来源:chemistry_multi.C
示例11: paintColumns
void paintColumns()
{
for(size_t i=0;i< columns.size();++i)
{
}
}
开发者ID:BioWu,项目名称:variationtoolkit,代码行数:7,代码来源:angelheart.cpp
示例12: clear
void clear()
{
genes.clear();
chromStart=-1;
chromEnd=-1;
positions.clear();
sample2positions.clear();
}
开发者ID:BioWu,项目名称:variationtoolkit,代码行数:8,代码来源:ucscgenesps.cpp
示例13:
void
Movement1D::initialize_derived (const Soil& soil,
const Groundwater& groundwater,
bool has_macropores, Treelog& msg)
{
TREELOG_MODEL (msg);
for (size_t i = 0; i < matrix_water.size (); i++)
matrix_water[i]->has_macropores (has_macropores);
}
开发者ID:pamoakoy,项目名称:daisy-model,代码行数:10,代码来源:movement_1D.C
示例14: iterate
void ErrorEstimatorImpl::iterate()
{
iterationCount_++;
massSpreads_.clear();
int measurementCount = int(measurements_.size());
for (int i=0; i<measurementCount; i++)
calculateMassSpread(measurements_[i]);
double errorSum = 0;
for (int i=0; i<measurementCount; i++)
errorSum += massSpreads_[i]->error();
error_ = sqrt(errorSum/measurementCount);
if (outputFile_)
output(outputFile_);
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:20,代码来源:ErrorEstimator.cpp
示例15: calculateMassSpread
void ErrorEstimatorImpl::calculateMassSpread(double measurement)
{
auto_ptr<const MassSpread> massSpread(MassSpread::create(measurement, error_, &massDatabase_));
massSpreads_.push_back(massSpread);
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:5,代码来源:ErrorEstimator.cpp
示例16: main
int main(int argc,char** argv)
{
const char* exonFile=0;
int optind=1;
char* faidxfile=NULL;
while(optind < argc)
{
if(strcmp(argv[optind],"-h")==0)
{
this->usage(cerr,argc,argv);
return(EXIT_FAILURE);
}
else if(strcmp(argv[optind],"-f")==0 && optind+1< argc)
{
faidxfile = argv[++optind];
}
else if(strcmp(argv[optind],"-g")==0 && optind+1< argc)
{
exonFile=argv[++optind];
}
else if(strcmp(argv[optind],"--")==0)
{
++optind;
break;
}
else if(argv[optind][0]=='-')
{
cerr << "unknown option '" << argv[optind]<< "'" << endl;
this->usage(cerr,argc,argv);
return EXIT_FAILURE;
}
else
{
break;
}
++optind;
}
if(faidxfile==0)
{
cerr << "no fasta genome defined." << endl;
this->usage(cerr,argc,argv);
return EXIT_FAILURE;
}
this->faidx.reset(new IndexedFasta(faidxfile));
if(exonFile==0)
{
cerr << "no bed for exons defined." << endl;
this->usage(cerr,argc,argv);
return EXIT_FAILURE;
}
if(optind==argc)
{
cerr << "BAM files missing"<< endl;
return EXIT_FAILURE;
}
else
{
while(optind< argc)
{
char* bamfile=argv[optind++];
WHERE("Open "<< bamfile);
BamFile2* bam=new BamFile2(bamfile);
this->bamFiles.push_back(bam);
bam->open(true);
}
}
//open exon file
igzstreambuf buf(exonFile);
istream in(&buf);
this->readExons(in);
buf.close();
if(exons.empty())
{
cerr << "No exon.\n";
return EXIT_FAILURE;
}
run();
for(size_t i=0;i< bamFiles.size();++i)
{
bamFiles[i]->close();
}
return EXIT_SUCCESS;
}
开发者ID:BioWu,项目名称:variationtoolkit,代码行数:93,代码来源:redondepth.cpp
注:本文中的auto_vector类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论