本文整理汇总了C++中PathList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ PathList::size方法的具体用法?C++ PathList::size怎么用?C++ PathList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathList
的用法示例。
在下文中一共展示了PathList::size方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: listDir
size_t Path::listDir(PathList &l, bool recurse, unsigned short flags) const {
EachFunc func;
details::DirLister dl(l);
Bind(&dl, &details::DirLister::dirItem, func);
l.clear();
each(func, recurse, flags);
return l.size();
}
示例2: SetAutoLoadPaths
void ModuleSettings::SetAutoLoadPaths(const PathList& paths)
{
PathList normalizedPaths;
normalizedPaths.resize(paths.size());
std::transform(paths.begin(), paths.end(), normalizedPaths.begin(), RemoveTrailingPathSeparator);
US_UNUSED(ModuleSettingsPrivate::Lock(moduleSettingsPrivate()));
moduleSettingsPrivate()->autoLoadPaths.clear();
moduleSettingsPrivate()->autoLoadPaths.insert(normalizedPaths.begin(), normalizedPaths.end());
}
示例3: findLinearIntersections
/* public */
void
SharedPathsOp::getSharedPaths(PathList& forwDir, PathList& backDir)
{
PathList paths;
findLinearIntersections(paths);
for (size_t i=0, n=paths.size(); i<n; ++i)
{
LineString* path = paths[i];
if ( isSameDirection(*path) ) forwDir.push_back(path);
else backDir.push_back(path);
}
}
示例4: add_to_vector
// helps fill in the path matrix (see below)
void add_to_vector (PathList& previous_vector, wstring* to_add) {
wstring string_rep = represent_path (to_add, 2);
if (previous_vector.size() == 0) {
previous_vector.push_back (string_rep);
}
else {
PathList::iterator it;
// if there is more than one possible path, add to all of them
for (it=previous_vector.begin(); it != previous_vector.end(); it++) {
it->append (string_rep);
}
}
}
示例5: BFS
// Run BFS to fill current gap
void GapFiller::BFS(size_t left_index, size_t right_index, int gap, GapInfo* gapinfo) {
int dis = gap + (_K-1+3*_DELTA) +30; //gap constraints
PathList pathlist;
BFS(_uniq_graph, left_index, right_index, dis, _STEP, 1000, pathlist);
if (pathlist.empty()) {
const std::string& lsequence = _uniq_graph._indexer[left_index].seq;
const std::string& rsequence = _uniq_graph._indexer[right_index].seq;
BFS(_all_graph, lsequence, rsequence, dis, _STEP, 2000, pathlist);
}
if (!pathlist.empty()) {
if (pathlist.size() <= MAX_CHOICE) {
if (gapinfo != NULL) {
gapinfo->graph = 0;
gapinfo->pathlist = pathlist;
}
} else {
if (gapinfo != NULL) {
gapinfo->graph = -1;
}
}
}
}
示例6: findLoggingConfigFile
fs::path findLoggingConfigFile() {
PathList configs = findLoggingConfigFiles(findExecutablePath());
if (configs.size())
return *configs.begin();
return fs::path();
}
示例7: findTextureDir
fs::path findTextureDir() {
PathList textures = findTextureDirs(findExecutablePath());
if (textures.size())
return *textures.begin();
return fs::path();
}
示例8: writeShortPath
/**
* @brief ShortPathWriter::writeShortPath - Save exist short path in open file
* @param fp - open file pointer
* @param pathIt - Iterator on exist short path
* @param options - some options (PRINT_INDENTS)
*/
void ShortPathWriter::writeShortPath(FILE* fp, RootPathList::iterator pathIt,
cuint options)
{
unsigned parentId = pathIt->first;
ShortPathElem* pathElem = pathIt->second->getNodes();
PathList* pathList = pathElem->getPathList();
if (pathList == nullptr)
{
return;
}
unsigned nodeId;
float weight;
bool isFirst = true;
std::deque <PathListItPair> pathStack;
unsigned currentIndent = 1;
bool printIndents = options & (unsigned) Option::PRINT_INDENTS;
pathStack.push_front( PathListItPair(pathList->begin(), pathList->end()) );
fprintf(fp, "%u(", parentId);
if (printIndents)
{
fputc('\n', fp);
}
while (pathStack.size())
{
auto pathIt = pathStack.front().first;
auto pathEnd = pathStack.front().second;
if (pathIt == pathEnd)
{
pathStack.pop_front();
--currentIndent;
if (printIndents)
{
for(unsigned i = 0u; i < currentIndent; ++i)
{
fputc('\t', fp);
}
fputs(")\n", fp);
}
else
{
fputc(')', fp);
}
continue;
}
nodeId = pathIt->first;
pathElem = pathIt->second;
pathList = pathElem->getPathList();
if (printIndents)
{
for(unsigned i = 0u; i < currentIndent; ++i)
{
fputc('\t', fp);
}
}
else if (!isFirst)
{
fputc(' ', fp);
}
else {
isFirst = false;
}
weight = pathElem->getWeight();
fprintf(fp, "%u[%g]", nodeId, weight);
++(pathStack.front().first);
if (pathList && pathList->size())
{
fputc('(', fp);
// Move to next elem
// go to next child
pathStack.push_front( PathListItPair(pathList->begin(),
pathList->end()) );
isFirst = true;
++currentIndent;
}
if (printIndents)
{
fputc('\n', fp);
}
}
}