src/class.cpp
/*!
 * \fn int attributeIndex(const std::string& attrName) const
 * \brief returns the index of a data member given its name
 * 
 * The data members of the base classes are considered by this function.
 */
\fn int attributeIndex(const std::string& attrName) const
\brief returns the index of a data member given its name

The data members of the base classes are considered by this function.
\ fn int attributeIndex ( const std :: string& attrName ) const \ brief returns the index of a data member given its name The data members of the base classes are considered by this function .
int Class::attributeIndex(const std::string& attrName) const
{
  int offset = attributesOffset();
  for (size_t i(0); i < d->dataMembers.size(); ++i)
  {
    if (d->dataMembers[i].name == attrName)
      return offset + static_cast<int>(i);
  }
  Class p = parent();
  if (p.isNull())
    return -1;
  return p.attributeIndex(attrName);
}
int Class :: attributeIndex ( const std :: string & attrName ) const { int offset = attributesOffset ( ) ; for ( size_t i ( 0 ) ; i < d -> dataMembers . size ( ) ; ++ i ) { if ( d -> dataMembers [ i ] . name == attrName ) return offset + static_cast < int > ( i ) ; } Class p = parent ( ) ; if ( p . isNull ( ) ) return -1 ; return p . attributeIndex ( attrName ) ; }
\fn int attributeIndex(const std::string& attrName) const
 \brief returns the index of a data member given its name
\ fn int attributeIndex ( const std :: string& attrName ) const \ brief returns the index of a data member given its name