OEHasRole

class OEHasRole : public OESystem::OEUnaryPredicate<OERoleSet>

This class represents OEHasRole, a functor for objects inherited from OERoleSet that identifies those containing a specified role (OERole).

pred = OEHasRole(role)
if pred(frag):
    print ("has role: ", role.GetName())

The following methods are publicly inherited from OEUnaryPredicate:

operator() CreateCopy CreatePredicateCopy

The following methods are publicly inherited from OEUnaryFunction:

operator() CreateCopy  

Constructors

OEHasRole(const OERole &role)

Copy constructor.

OEHasRole(const std::string &name)

Convenience constructor allowing the predicate to be constructed from a role name string.

operator()

bool operator()(const OERoleSet &myObject) const

Returns true if the OERoleSet contains an OERole that matches the value used in the OEHasRole.Constructors.

CreateCopy

OESystem::OEUnaryFunction<OERoleSet , bool> *CreateCopy() const

Deep copy constructor that returns a copy of the object. The memory for the returned OEHasRole object is dynamically allocated and owned by the caller.