xmol::proxy::smart::MoleculeSmartRef class

Smart Molecule reference proxy.

Base classes

template<typename Observer>
class FrameObserver<MoleculeSmartRef>

Constructors, destructors, conversion operators

MoleculeSmartRef(MoleculeRef mol)
operator MoleculeRef&()
operator const MoleculeRef&() const

Public functions

auto name() const -> const MoleculeName&
Molecule name.
auto name(const MoleculeName& name) -> MoleculeRef&
auto empty() const -> bool
Check if molecule has no residues.
auto size() const -> size_t
Number of residues in molecule.
auto frame() -> Frame&
Parent frame.
auto index() const -> MoleculeIndex
auto residues() -> ResidueSpan
Residues of the molecule.
auto atoms() -> AtomSpan
Atoms of the molecule.
auto coords() -> CoordSpan
Atoms coordinates of the residue.
auto operator!=(const MoleculeRef& rhs) const -> bool
Check if references point to same data.
auto operator==(const MoleculeRef& rhs) const -> bool
Check if references point to same data.
auto operator[](const ResidueId& id) -> std::optional<ResidueRef>
Get children residue by id.
auto operator[](residueSerial_t id) -> std::optional<ResidueRef>
Get children residue by id.
auto add_residue() -> ResidueRef
Adds residue to the end of the molecule and return its reference.

Function documentation

ResidueRef xmol::proxy::smart::MoleculeSmartRef::add_residue()

Adds residue to the end of the molecule and return its reference.

Invalidates all kinds of non-smart residue references including proxy::ResidueRef, proxy::ResidueRefSpan and proxy::ResidueSelection

Appropriate Frame::reserve_residues() call prevents references invalidation