MemberAccessor
- class MemberAccessor[R, M]
-
Children
Members defined in
MemberAccessor(6 members)
RThe
member_elementof thismemberif it is not empty.
RThe
membershipof thismemberif it is not empty.
Extract the
member_elementleaving thismemberempty. Note that not all emptymembersare valid textual syntax. This does not check that the model is left in a valid state.
Remove the
member_elementleaving thismemberempty. Note that not all emptymembersare valid textual syntax. This does not check that the model is left in a valid state.
Set a new
member_element.elementwill only be referenced if themembershipisMembership, otherwise ownership constraints apply. Replaces the previousmember_element, which may be reused by the model if it was owned. Attributes
- property member_element: syside.M
The
member_elementof thismemberif it is not empty.
- property membership: syside.R
The
membershipof thismemberif it is not empty.
Methods
- __bool__() bool
- extract_member_element() syside.M
Extract the
member_elementleaving thismemberempty. Note that not all emptymembersare valid textual syntax. This does not check that the model is left in a valid state.Note that it is up to the user to ensure that the returned orphan element is not leaked.
Raises
ValueErrorif member is empty.
- remove_member_element() None
Remove the
member_elementleaving thismemberempty. Note that not all emptymembersare valid textual syntax. This does not check that the model is left in a valid state.
- set_member_element(element: syside.M, name: syside.NameID = ...) tuple[syside.R, syside.M]
Set a new
member_element.elementwill only be referenced if themembershipisMembership, otherwise ownership constraints apply. Replaces the previousmember_element, which may be reused by the model if it was owned.Returns a pair of (
membership,member_element) wheremember_elementiselement.
- set_member_element(element: syside.M | None, name: syside.NameID = ...) tuple[syside.R, syside.M] | None
set_member_elementoverload that will remove the member element ifelementisNone, otherwise the behaviour is the same.