Esempio n. 1
0
const Property& Class::property(const std::string& id) const
{
    PropertyTable::const_iterator it;
    if (!m_properties.tryFind(id, it))
    {
        PONDER_ERROR(PropertyNotFound(id, name()));
    }

    return *it->second;
}
Esempio n. 2
0
//-------------------------------------------------------------------------------------------------
const Property& Class::property(const std::string& name, bool ownOnly /*= false*/) const
{
    const PropertyNameIndex& names = (ownOnly?m_own_properties:m_properties).get<Name>();

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

    return **it;
}