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


C++ BaseType::name方法代码示例

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


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

示例1: Open


//.........这里部分代码省略.........
    }

    /* -------------------------------------------------------------------- */
    /*      We presume we only work with version 3 servers.                 */
    /* -------------------------------------------------------------------- */

    if (version.empty() || version.find("/3.") == string::npos)
    {
        CPLError( CE_Warning, CPLE_AppDefined,
                  "I connected to the URL but could not get a DAP 3.x version string\n"
                  "from the server.  I will continue to connect but access may fail.");
    }

    /* -------------------------------------------------------------------- */
    /*      Fetch the DAS and DDS info about the server.                    */
    /* -------------------------------------------------------------------- */
    try
    {
        poConnection->request_das( oDAS );
        poConnection->request_dds( *poDDS, oProjection + oConstraints );
    }
    catch (Error &e)
    {
        CPLError(CE_Failure, CPLE_AppDefined,
                 "Error fetching DAS or DDS:\n%s",
                 e.get_error_message().c_str() );
        return FALSE;
    }

    /* -------------------------------------------------------------------- */
    /*      Do we have any ogr_layer_info attributes in the DAS?  If so,    */
    /*      use them to define the layers.                                  */
    /* -------------------------------------------------------------------- */
    AttrTable::Attr_iter dv_i;

#ifdef LIBDAP_39
    AttrTable* poTable = oDAS.container();
    if (poTable == NULL)
    {
        CPLError(CE_Failure, CPLE_AppDefined, "Cannot get container");
        return FALSE;
    }
#else
    AttrTable* poTable = &oDAS;
#endif

    for( dv_i = poTable->attr_begin(); dv_i != poTable->attr_end(); dv_i++ )
    {
        if( EQUALN(poTable->get_name(dv_i).c_str(),"ogr_layer_info",14)
                && poTable->is_container( dv_i ) )
        {
            AttrTable *poAttr = poTable->get_attr_table( dv_i );
            string target_container = poAttr->get_attr( "target_container" );
            BaseType *poVar = poDDS->var( target_container.c_str() );

            if( poVar == NULL )
            {
                CPLError( CE_Warning, CPLE_AppDefined,
                          "Unable to find variable '%s' named in\n"
                          "ogr_layer_info.target_container, skipping.",
                          target_container.c_str() );
                continue;
            }

            if( poVar->type() == dods_sequence_c )
                AddLayer(
                    new OGRDODSSequenceLayer(this,
                                             target_container.c_str(),
                                             poAttr) );
            else if( poVar->type() == dods_grid_c
                     || poVar->type() == dods_array_c )
                AddLayer( new OGRDODSGridLayer(this,target_container.c_str(),
                                               poAttr) );
        }
    }

    /* -------------------------------------------------------------------- */
    /*      Walk through the DODS variables looking for easily targetted    */
    /*      ones.  Eventually this will need to be driven by the AIS info.  */
    /* -------------------------------------------------------------------- */
    if( nLayers == 0 )
    {
        DDS::Vars_iter v_i;

        for( v_i = poDDS->var_begin(); v_i != poDDS->var_end(); v_i++ )
        {
            BaseType *poVar = *v_i;

            if( poVar->type() == dods_sequence_c )
                AddLayer( new OGRDODSSequenceLayer(this,poVar->name().c_str(),
                                                   NULL) );
            else if( poVar->type() == dods_grid_c
                     || poVar->type() == dods_array_c )
                AddLayer( new OGRDODSGridLayer(this,poVar->name().c_str(),
                                               NULL) );
        }
    }

    return TRUE;
}
开发者ID:wlhm1984,项目名称:osgEarthX,代码行数:101,代码来源:ogrdodsdatasource.cpp

示例2: write


//.........这里部分代码省略.........
    // 8.b  (qint32) 1st id of variable with alternatives
    // 8.c  (qint32) number of type alternatives
    // 8.d  (AltRefType) 1st alternative
    // 8.e  (AltRefType) 2nd alternative
    // 8.f  (AltRefType) ...
    // 8.g  (qint32) 2st id of variable with alternatives
    // 8.h  (qint32) number of type alternatives
    // 8.i  (AltRefType) 1st alternative
    // 8.j  (AltRefType) 2nd alternative
    // 8.k  (AltRefType) ...
    // 8.l  ...

    try {
        QSet<qint32> written_types;

        // Write the memory specifications
        out << *_specs;
#ifdef WRITE_ASCII_FILE
        dout << endl << "# Memory specifications" << endl
                << _specs->toString();
#endif

        // Write list of compile units
        out << (qint32) _factory->sources().size();
#ifdef WRITE_ASCII_FILE
        dout << endl << "# Compile units" << endl
             << _factory->sources().size() << endl;
#endif
        CompileUnitIntHash::const_iterator cu_it = _factory->sources().constBegin();
        while (cu_it != _factory->sources().constEnd()) {
            const CompileUnit* c = cu_it.value();
            out << *c;
#ifdef WRITE_ASCII_FILE
            dout << "0x" << hex << c->id() << " " << c->name() << endl;
#endif
            ++cu_it;
            checkOperationProgress();
        }

        // Write list of types
        const int types_to_write = _factory->types().size();
        out << (qint32) types_to_write;

#ifdef WRITE_ASCII_FILE
        dout << endl << "# Types" << endl
             << dec << types_to_write << endl;
#endif

        // Make three rounds: first write elementary types, then the
        // simple referencing types, finally the structs and unions
        for (int round = 0; round < 3; ++round) {
            int mask = ElementaryTypes;
            switch (round) {
            case 1: mask = ReferencingTypes & ~StructOrUnion; break;
            case 2: mask = StructOrUnion; break;
            }

            for (int i = 0; i < _factory->types().size(); i++) {
                BaseType* t = _factory->types().at(i);
                if (t->type() & mask) {

                    out << (qint32) t->type();
                    out << *t;

#ifdef WRITE_ASCII_FILE
                    dout << "0x" << hex << t->id() << " "
开发者ID:wxdublin,项目名称:insight-vmi,代码行数:67,代码来源:kernelsymbolwriter.cpp


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