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 = oechem.OEHasRole(role)
if pred(frag):
print("has role: ", role.GetName())
The following methods are publicly inherited from OEUnaryPredicate:
The following methods are publicly inherited from OEUnaryFunction:
Constructors
OEHasRole(role: OERole) -> OEHasRole
Copy constructor.
OEHasRole(name: str) -> OEHasRole
Convenience constructor allowing the predicate to be constructed from a role name string.
operator()
__call__(someObject: OERoleSet) -> bool
Returns true if the OERoleSet contains
an OERole that
matches the value used in the OEHasRole.Constructors.
CreateCopy
CreateCopy() -> OEHasRole
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.