本文整理汇总了C++中objectRegistry::path方法的典型用法代码示例。如果您正苦于以下问题:C++ objectRegistry::path方法的具体用法?C++ objectRegistry::path怎么用?C++ objectRegistry::path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类objectRegistry
的用法示例。
在下文中一共展示了objectRegistry::path方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readDir
Foam::IOobjectList::IOobjectList
(
const objectRegistry& db,
const fileName& instance,
const fileName& local,
IOobject::readOption r,
IOobject::writeOption w,
bool registerObject
)
:
HashPtrTable<IOobject>()
{
word newInstance = instance;
if (!isDir(db.path(instance)))
{
newInstance = db.time().findInstancePath(instant(instance));
if (newInstance.empty())
{
return;
}
}
// Create a list of file names in this directory
fileNameList ObjectNames =
readDir(db.path(newInstance, db.dbDir()/local), fileName::FILE);
forAll(ObjectNames, i)
{
IOobject* objectPtr = new IOobject
(
ObjectNames[i],
newInstance,
local,
db,
r,
w,
registerObject
);
if (objectPtr->headerOk())
{
insert(ObjectNames[i], objectPtr);
}
else
{
delete objectPtr;
}
}
示例2: readDir
Foam::IOobjectList::IOobjectList
(
const objectRegistry& db,
const fileName& instance,
const fileName& local
)
:
HashPtrTable<IOobject>()
{
word newInstance = instance;
if (!isDir(db.path(instance)))
{
newInstance = db.time().findInstancePath(instant(instance));
if (newInstance.empty())
{
return;
}
}
// Create list file names in directory
fileNameList ObjectNames =
readDir(db.path(newInstance, db.dbDir()/local), fileName::FILE);
forAll(ObjectNames, i)
{
IOobject* objectPtr = new IOobject
(
ObjectNames[i],
newInstance,
local,
db,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (objectPtr->headerOk())
{
insert(ObjectNames[i], objectPtr);
}
else
{
delete objectPtr;
}
}
示例3:
Foam::fileNameList
Foam::fileOperations::autoParallelFileOperation::readObjects
(
const objectRegistry& db,
const fileName& instance,
const fileName& local,
word& newInstance
) const
{
fileNameList objects;
if (!Pstream::parRun())
{
objects = uncollatedFileOperation::readObjects
(
db,
instance,
local,
newInstance
);
}
else
{
// tbd: lagrangian. dbDir="", local = "lagrangian/KinematicCloud"
fileName path
(
filePath
(
db.rootPath()
/db.time().globalCaseName()
/instance
/db.dbDir()
/local
)
);
if (Foam::isDir(path))
{
newInstance = instance;
objects = Foam::readDir(path, fileType::file);
if (debug)
{
Pout<< indent
<< "autoParallelFileOperation::readObjects :"
<< " Returning parent directory searching:"
<< endl << indent
<< " path :" << path << endl << indent
<< " objects :" << objects << endl << endl;
}
return objects;
}
else
{
objects = uncollatedFileOperation::readObjects
(
db,
instance,
local,
newInstance
);
}
}
if (debug)
{
Pout<< indent
<< "autoParallelFileOperation::readObjects :"
<< " Returning from directory searching:" << endl << indent
<< " path :" << db.path(instance, db.dbDir()/local)
<< endl << indent
<< " objects :" << objects << endl << indent
<< " newInst :" << newInstance << endl << endl;
}
return objects;
}