00001
00002
00003 template< class T > bool
00004 Anaphe::AIDA_Tuple_native::TupleVariableDescriptionBuilder::buildDescriptionT( T& t,
00005 const std::vector<std::string>& variableNames,
00006 const std::vector<std::string>& variableTypes )
00007 {
00008 if ( variableNames.size() != variableTypes.size() ) return false;
00009 for ( unsigned int i = 0; i < variableNames.size(); ++i ) {
00010 const std::string& name = variableNames[i];
00011 AIDA::Dev::ITupleVariableDescription* description = m_factory.createDescription();
00012 if ( ! description ) return false;
00013 description->setVariableName( name );
00014 const std::string& type = variableTypes[i];
00015 std::string::size_type pos = type.find( "uple" );
00016 if ( pos == std::string::npos ) {
00017 pos = type.find( "tring" );
00018 if ( pos == std::string::npos ) {
00019 description->setVariableType( type );
00020 }
00021 else {
00022 description->setVariableType( "std::string" );
00023 }
00024 }
00025 else {
00026 description->setVariableType( "AIDA::ITuple" );
00027
00028 std::string tupleDescription = type.substr( type.find( "{" ) );
00029 if ( tupleDescription.size() == 0 ) return false;
00030
00031 if (! buildDescription( *description, tupleDescription ) ) return false;
00032 }
00033 if ( ! t.setVariableDescription( description, true ) ) return false;
00034 }
00035 return true;
00036 }