本文整理汇总了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;
}
示例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() << " "