From Marco Jez, updates to osgIntrospection.
This commit is contained in:
@@ -13,3 +13,48 @@ void MethodInfo::getInheritedProviders(CustomAttributeProviderList &providers) c
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool MethodInfo::overrides(const MethodInfo *other) const
|
||||
{
|
||||
if (isConst() != other->isConst()) return false;
|
||||
if (decltype_ != other->decltype_) return false;
|
||||
if (rtype_ != other->rtype_) return false;
|
||||
if (name_ != other->name_) return false;
|
||||
if (params_.size() != other->params_.size()) return false;
|
||||
|
||||
ParameterInfoList::const_iterator i=params_.begin();
|
||||
ParameterInfoList::const_iterator j=other->params_.begin();
|
||||
for (; i!=params_.end(); ++i, ++j)
|
||||
{
|
||||
if (&(*i)->getParameterType() != &(*j)->getParameterType())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
/*
|
||||
std::size_t num_fixed_1 = 0;
|
||||
std::size_t num_optional_1 = 0;
|
||||
for (ParameterInfoList::const_iterator i=params_.begin(); i!=params_.end(); ++i)
|
||||
{
|
||||
if ((*i)->getDefaultValue().isEmpty())
|
||||
++num_fixed_1;
|
||||
else
|
||||
++num_optional_1;
|
||||
}
|
||||
|
||||
std::size_t num_fixed_2 = 0;
|
||||
std::size_t num_optional_2 = 0;
|
||||
for (ParameterInfoList::const_iterator i=other->params_.begin(); i!=other->params_.end(); ++i)
|
||||
{
|
||||
if ((*i)->getDefaultValue().isEmpty())
|
||||
++num_fixed_2;
|
||||
else
|
||||
++num_optional_2;
|
||||
}
|
||||
|
||||
if (num_fixed_1 > num_fixed_2)
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user