OERoleSet¶
class OERoleSet
This class represents OERoleSet, a parent class for objects that need to store OERole objects.
An OERole
is an object that helps
define a classification (naming) scheme
to represent a category or functional role.
OERole role("my:analysis:active-site");
std::cout << role.GetName() << std::endl;
Objects derived from OERoleSet can
have OERole
objects added
to them as a way of marking them for particular uses.
OEAtomBondSet frag; // is a OERoleSet
frag.AddRole(role);
- The following classes derive from this class:
It is possible to test if an OERole
has been added using the HasRole
method, or with the OEHasRole predicate.
AddRole¶
bool AddRole(const OERole &role)
Add the specified OERole
to
this OERoleSet
.
Returns true
if successful.
bool AddRole(const std::string &name)
Convenience method for adding a
OERole
by name.
frag.AddRole("my:analysis:low-energy");
DeleteRole¶
bool DeleteRole(const OERole &role)
bool DeleteRole(const std::string &name)
Delete the specified OERole
from
this OERoleSet
.
Returns true
if successful.
frag.DeleteRole(role);
frag.DeleteRole("my:analysis:some-role");
GetRoles¶
OEIterBase<const OERole> *GetRoles() const
Returns an iterator of every OERole
object
in this OERoleSet
.
for (OEIter<const OERole> r = frag.GetRoles(); r; ++r)
std::cout << r->GetName() << " " << std::endl;
HasRole¶
bool HasRole(const OERole &role) const
Returns true
if the OERoleSet
contains
the specified role.
OERole role2("my:analysis:low-energy");
std::cout << frag.HasRole(role2) << std::endl;
bool HasRole(const std::string &name) const
Convenience method for testing membership with a string.
std::cout << frag.HasRole("my:analysis:small") << std::endl;