Esempio n. 1
0
const Function& Class::function(const std::string& id) const
{
    FunctionTable::const_iterator it;
    if (!m_functions.tryFind(id, it))
    {
        PONDER_ERROR(FunctionNotFound(id, name()));
    }

    return *it->second;
}
Esempio n. 2
0
//-------------------------------------------------------------------------------------------------
const Function& Class::function(const std::string& name, bool ownOnly /*= false*/) const
{
    const FunctionNameIndex& names = (ownOnly?m_own_functions:m_functions).get<Name>();

    FunctionNameIndex::const_iterator it = names.find(name);
    if (it == names.end())
        CAMP_ERROR(FunctionNotFound(name, m_name));

    return **it;
}