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


C++ ScalarConstPtr::get方法代码示例

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


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

示例1: isCompatible

    static bool isCompatible(StructureConstPtr const &structure)
    {
        if(!structure.get()) return false;

        if (structure->getID() != "dimension_t") return false;

        ScalarConstPtr scalarField = structure->getField<Scalar>("size");
        if (scalarField.get() == 0 || scalarField->getScalarType() != pvInt)
            return false;

        scalarField = structure->getField<Scalar>("offset");
        if (scalarField.get() == 0 || scalarField->getScalarType() != pvInt)
            return false;

        scalarField = structure->getField<Scalar>("fullSize");
        if (scalarField.get() == 0 || scalarField->getScalarType() != pvInt)
            return false;

        scalarField = structure->getField<Scalar>("binning");
        if (scalarField.get() == 0 || scalarField->getScalarType() != pvInt)
            return false;

        scalarField = structure->getField<Scalar>("reverse");
        if (scalarField.get() == 0 || scalarField->getScalarType() != pvBoolean)
            return false;

        return true;
    }
开发者ID:mdavidsaver,项目名称:normativeTypesCPP,代码行数:28,代码来源:ntndarray.cpp

示例2: isCompatible

bool NTHistogram::isCompatible(StructureConstPtr const &structure)
{
    if(!structure.get()) return false;

    ScalarArrayConstPtr rangesField = structure->getField<ScalarArray>("ranges");
    if(!rangesField.get() || rangesField->getElementType() != pvDouble) return false;

    ScalarArrayConstPtr valueField = structure->getField<ScalarArray>("value");
    if(!valueField.get()) return false;

    ScalarType scalarType = valueField->getElementType();
    if (scalarType != pvShort &&
        scalarType != pvInt &&
        scalarType != pvLong)
        return false;

    FieldConstPtr field = structure->getField("descriptor");
    if(field)
    {
       ScalarConstPtr descriptorField = structure->getField<Scalar>("descriptor");
       if (!descriptorField.get() || descriptorField->getScalarType() != pvString)
           return false;
    }

    field = structure->getField("alarm");
    if (field.get() && !ntField->isAlarm(field))
        return false;

    field = structure->getField("timeStamp");
    if (field.get() && !ntField->isTimeStamp(field))
        return false;

    return true;
}
开发者ID:mdavidsaver,项目名称:normativeTypesCPP,代码行数:34,代码来源:nthistogram.cpp

示例3: isCompatible

bool NTAttribute::isCompatible(StructureConstPtr const & structure)
{
    if (structure.get() == 0) return false;

    ScalarConstPtr nameField = structure->getField<Scalar>("name");
    if (nameField.get() == 0 || nameField->getScalarType() != pvString)
        return false;

    UnionConstPtr valueField = structure->getField<Union>("value");
    if (valueField.get() == 0 || !valueField->isVariant())
        return false;

    FieldConstPtr field = structure->getField("tags");
    if (field.get())
    {
        ScalarArrayConstPtr tagsField = structure->getField<ScalarArray>("tags");
        if (tagsField.get() == 0 || tagsField->getElementType() != pvString)
            return false;
    }

    field = structure->getField("descriptor");
    if (field.get())
    {
        ScalarConstPtr descriptorField = structure->getField<Scalar>("descriptor");
        if (!descriptorField.get() || descriptorField->getScalarType() != pvString)
            return false;
    }

    NTFieldPtr ntField = NTField::get();

    field = structure->getField("alarm");
    if (field.get() && !ntField->isAlarm(field))
        return false;

    field = structure->getField("timeStamp");
    if (field.get() && !ntField->isTimeStamp(field))
        return false;

    return true;
}
开发者ID:mdavidsaver,项目名称:normativeTypesCPP,代码行数:40,代码来源:ntattribute.cpp

示例4: isCompatible

bool NTScalar::isCompatible(StructureConstPtr const &structure)
{
    if (structure.get() == 0) return false;

    ScalarConstPtr valueField = structure->getField<Scalar>("value");
    if (valueField.get() == 0)
        return false;

    FieldConstPtr field = structure->getField("descriptor");
    if (field.get())
    {
        ScalarConstPtr descriptorField = structure->getField<Scalar>("descriptor");
        if (!descriptorField.get() || descriptorField->getScalarType() != pvString)
            return false;
    }

    NTFieldPtr ntField = NTField::get();

    field = structure->getField("alarm");
    if (field.get() && !ntField->isAlarm(field))
        return false;

    field = structure->getField("timeStamp");
    if (field.get() && !ntField->isTimeStamp(field))
        return false;

    field = structure->getField("display");
    if (field.get() && !ntField->isDisplay(field))
        return false;

    field = structure->getField("control");
    if (field.get() && !ntField->isControl(field))
        return false;

    return true;
}
开发者ID:epicsdeb,项目名称:epics-nt,代码行数:36,代码来源:ntscalar.cpp

示例5: test_builder

void test_builder()
{
    testDiag("test_builder");

    NTNDArrayAttributeBuilderPtr builder = NTNDArrayAttribute::createBuilder();
    testOk(builder.get() != 0, "Got builder");

    StructureConstPtr structure = builder->
            addTags()->
            addAlarm()->
            addTimeStamp()->
            add("extra",fieldCreate->createScalar(pvString)) ->
            createStructure();
    testOk1(structure.get() != 0);
    if (!structure)
        return;

    testOk1(NTNDArrayAttribute::is_a(structure));
    testOk1(structure->getID() == NTNDArrayAttribute::URI);
    testOk1(structure->getNumberFields() == 9);
    testOk1(structure->getField("name").get() != 0);
    testOk1(structure->getField("value").get() != 0);
    testOk1(structure->getField("tags").get() != 0);
    testOk1(structure->getField("descriptor").get() != 0);
    testOk1(structure->getField("alarm").get() != 0);
    testOk1(structure->getField("timeStamp").get() != 0);
    testOk1(structure->getField("sourceType").get() != 0);
    testOk1(structure->getField("source").get() != 0);

    ScalarConstPtr nameField = structure->getField<Scalar>("name");
    testOk(nameField.get() != 0 && nameField->getScalarType() == pvString,
        "name is string");

    UnionConstPtr valueField = structure->getField<Union>("value");
    testOk(valueField.get() != 0, "value is enum");

    ScalarArrayConstPtr tagsField = structure->getField<ScalarArray>("tags");
    testOk(tagsField.get() != 0 && tagsField->getElementType() == pvString,
        "tags is string[]");

    std::cout << *structure << std::endl;

}
开发者ID:mdavidsaver,项目名称:normativeTypesCPP,代码行数:43,代码来源:ntndarrayAttributeTest.cpp

示例6: isCompatible

bool NTMatrix::isCompatible(StructureConstPtr const & structure)
{
    if (structure.get() == 0) return false;

    ScalarArrayConstPtr valueField = structure->getField<ScalarArray>("value");
    if (valueField.get() == 0 || valueField->getElementType() != pvDouble)
        return false;

    FieldConstPtr field = structure->getField("dim");
    if (field.get())
    {
        ScalarArrayConstPtr dimField = structure->getField<ScalarArray>("dim");
        if (dimField.get() == 0 || dimField->getElementType() != pvInt)
            return false;
    }

    field = structure->getField("descriptor");
    if (field.get())
    {
        ScalarConstPtr descriptorField = structure->getField<Scalar>("descriptor");
        if (!descriptorField.get() || descriptorField->getScalarType() != pvString)
            return false;
    }

    NTFieldPtr ntField = NTField::get();

    field = structure->getField("alarm");
    if (field.get() && !ntField->isAlarm(field))
        return false;

    field = structure->getField("timeStamp");
    if (field.get() && !ntField->isTimeStamp(field))
        return false;

    field = structure->getField("display");
    if (field.get() && !ntField->isDisplay(field))
        return false;

    return true;
}
开发者ID:mdavidsaver,项目名称:normativeTypesCPP,代码行数:40,代码来源:ntmatrix.cpp


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