当前位置: 首页>>代码示例>>C++>>正文


C++ dictionary::toc方法代码示例

本文整理汇总了C++中dictionary::toc方法的典型用法代码示例。如果您正苦于以下问题:C++ dictionary::toc方法的具体用法?C++ dictionary::toc怎么用?C++ dictionary::toc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dictionary的用法示例。


在下文中一共展示了dictionary::toc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: modelNames

Foam::ParticleForceList<CloudType>::ParticleForceList
(
    CloudType& owner,
    const fvMesh& mesh,
    const dictionary& dict,
    const bool readFields
)
:
    PtrList<ParticleForce<CloudType> >(),
    owner_(owner),
    mesh_(mesh),
    dict_(dict)
{
    if (readFields)
    {
        wordList modelNames(dict.toc());

        Info<< "Constructing particle forces" << endl;

        if (modelNames.size() > 0)
        {
            this->setSize(modelNames.size());

            label i = 0;
            forAllConstIter(IDLList<entry>, dict, iter)
            {
                const word& model = iter().keyword();
                if (iter().isDict())
                {
                    this->set
                    (
                        i++,
                        ParticleForce<CloudType>::New
                        (
                            owner,
                            mesh,
                            iter().dict(),
                            model
                        )
                    );
                }
                else
                {
                    this->set
                    (
                        i++,
                        ParticleForce<CloudType>::New
                        (
                            owner,
                            mesh,
                            dict,
                            model
                        )
                    );
                }
            }
        }
        else
        {
开发者ID:Washino,项目名称:WM_PROJECT_USER_DIR,代码行数:59,代码来源:ParticleForceList.C

示例2: varWord

Foam::string Foam::functionEntries::negEntry::negateVariable
(
    const dictionary& parentDict,
    Istream& is
)
{
    // Read variable name as a word including the '$'
    const word varWord(is);

    if (varWord[0] != '$')
    {
        FatalIOErrorInFunction
        (
            parentDict
        )   << "Expected variable name beginning with a '$' but found '"
            << varWord << "'" << exit(FatalIOError);

        return string::null;
    }

    // Strip the leading '$' from the variable name
    const string varName = varWord(1, varWord.size()-1);

    // Lookup the variable name in the parent dictionary....
    const entry* ePtr = parentDict.lookupScopedEntryPtr(varName, true, false);

    if (ePtr && ePtr->isStream())
    {
        const token variable(ePtr->stream());

        // Convert to a string
        OStringStream os(is.format());
        os << variable;
        const string str(os.str());

        // Negate
        if (str[0] == '-')
        {
            return str(1, str.size() - 1);
        }
        else
        {
            return '-' + str;
        }
    }
    else
    {
        FatalIOErrorInFunction
        (
            parentDict
        )   << "Illegal dictionary variable name " << varName << endl
            << "Valid dictionary entries are " << parentDict.toc()
            << exit(FatalIOError);

        return string::null;
    }
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:57,代码来源:negEntry.C

示例3: modelNames

Foam::regionModels::regionModelFunctionObjectList::regionModelFunctionObjectList
(
    regionModel& owner,
    const dictionary& dict,
    const bool readFields
)
:
    PtrList<regionModelFunctionObject>(),
    owner_(owner),
    dict_(dict)
{
    if (readFields)
    {
        wordList modelNames(dict.toc());

        Info<< "    Selecting region model functions" << endl;

        if (modelNames.size() > 0)
        {
            this->setSize(modelNames.size());

            forAll(modelNames, i)
            {
                const word& modelName = modelNames[i];

                this->set
                (
                    i,
                    regionModelFunctionObject::New
                    (
                        dict,
                        owner,
                        modelName
                    )
                );
            }
        }
        else
        {
开发者ID:ADGlassby,项目名称:OpenFOAM-2.2.x,代码行数:39,代码来源:regionModelFunctionObjectList.C

示例4: modelNames

Foam::CloudFunctionObjectList<CloudType>::CloudFunctionObjectList
(
    CloudType& owner,
    const dictionary& dict,
    const bool readFields
)
:
    PtrList<CloudFunctionObject<CloudType> >(),
    owner_(owner),
    dict_(dict)
{
    if (readFields)
    {
        wordList modelNames(dict.toc());

        Info<< "Constructing cloud functions" << endl;

        if (modelNames.size() > 0)
        {
            this->setSize(modelNames.size());

            forAll(modelNames, i)
            {
                const word& modelName = modelNames[i];

                this->set
                (
                    i,
                    CloudFunctionObject<CloudType>::New
                    (
                        dict,
                        owner,
                        modelName
                    )
                );
            }
        }
        else
        {
开发者ID:AmaneShino,项目名称:OpenFOAM-2.0.x,代码行数:39,代码来源:CloudFunctionObjectList.C

示例5: variables

void Foam::addGlobalVariable::read(const dictionary& dict)
{
    if(dict.found("globalVariables")) {
        const dictionary variables(dict.subDict("globalVariables"));
        const word scope(dict.lookup("globalScope"));

        wordList names(variables.toc());
        forAll(names,i) {
            const word &name=names[i];
            const dictionary &dict=variables.subDict(name);

            ExpressionResult &res=GlobalVariablesRepository::getGlobalVariables(
                obr_
            ).addValue(
                name,
                scope,
                ExpressionResult(dict,true,true),
                false
            );
            res.noReset();
        }
    } else {
开发者ID:aliozel,项目名称:swak4Foam,代码行数:22,代码来源:addGlobalVariable.C


注:本文中的dictionary::toc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。