Ejemplo n.º 1
0
bool Entity::matches(const TObject& other) const
{
    if (tObject_ == other) return true;

    bool ret = false;

    switch (matchLevel_) {
        case LevelNone:     // Never matches
            break;
        case LevelAny:     // Any TObject will do
            ret = true;
            break;
        case LevelTOType:
            ret = const_cast<TObjectType&>(tObject_.getType()) == other.getType();
            break;
        case LevelTOValue:
            ret = tObject_ == other;
            break;
        case LevelTOName:
            ret = tObject_.getName() == other.getName();
            break;
        default:
            break;
    }

    return ret;
}