Sets or unsets flags of the object.
Returns eOk if successful or an appropriate error code in the other case.