xmol::Frame class

Molecular frame, owns all molecular data.

Base classes

template<typename Observer>
class Observable<proxy::smart::AtomSmartRef>
Implements base primitives for observable entity.
template<typename Observer>
class Observable<proxy::smart::ResidueSmartRef>
Implements base primitives for observable entity.
template<typename Observer>
class Observable<proxy::smart::MoleculeSmartRef>
Implements base primitives for observable entity.
template<typename Observer>
class Observable<proxy::smart::AtomSmartSelection>
Implements base primitives for observable entity.
template<typename Observer>
class Observable<proxy::smart::ResidueSmartSelection>
Implements base primitives for observable entity.
template<typename Observer>
class Observable<proxy::smart::MoleculeSmartSelection>
Implements base primitives for observable entity.
template<typename Observer>
class Observable<proxy::smart::AtomSmartSpan>
Implements base primitives for observable entity.
template<typename Observer>
class Observable<proxy::smart::ResidueSmartSpan>
Implements base primitives for observable entity.
template<typename Observer>
class Observable<proxy::smart::MoleculeSmartSpan>
Implements base primitives for observable entity.
template<typename Observer>
class Observable<proxy::smart::CoordSmartSpan>
Implements base primitives for observable entity.
template<typename Observer>
class Observable<proxy::smart::CoordSmartSelection>
Implements base primitives for observable entity.

Constructors, destructors, conversion operators

Frame() defaulted
Default constructor.
Frame(const Frame& other)
Copy constructor.
Frame(Frame&& other)
Move constructor.
~Frame()
Destructor.

Public functions

auto operator=(const Frame& other) -> Frame&
Copy assignment.
auto operator=(Frame&& other) -> Frame&
Move assignment.
auto n_atoms() const -> size_t
Total number of atoms in the frame.
auto n_residues() const -> size_t
Total number of residues in the frame.
auto n_molecules() const -> size_t
Total number of molecules in the frame.
auto atoms() -> proxy::AtomSpan
Atoms of the frame.
auto residues() -> proxy::ResidueSpan
Residues of the frame.
auto molecules() -> proxy::MoleculeSpan
Molecules of the frame.
auto coords() -> proxy::CoordSpan
Coordinates of the frame.
template<typename Smart>
auto n_references() const -> size_t
Current number of smart atom references.
void reserve_atoms(size_t n)
Preallocate space for n atoms.
void reserve_residues(size_t n)
Preallocate space for n residues.
void reserve_molecules(size_t n)
Preallocate space for n molecules.
auto add_molecule() -> proxy::MoleculeRef
Add new molecules at the end of frame and return reference to it.
auto operator==(const Frame& rhs) const -> bool
auto operator!=(const Frame& rhs) const -> bool
auto operator[](const MoleculeName& name) -> std::optional<proxy::MoleculeRef>
auto operator[](const char* name) -> std::optional<proxy::MoleculeRef>

Public variables

geom::UnitCell cell
FrameIndex index
double time
Sequential index in trajectory.

Function documentation

void xmol::Frame::reserve_atoms(size_t n)

Preallocate space for n atoms.

Invalidates all kinds of non-smart atom references including AtomRef, AtomRefSpan and AtomSelection

void xmol::Frame::reserve_residues(size_t n)

Preallocate space for n residues.

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

void xmol::Frame::reserve_molecules(size_t n)

Preallocate space for n molecules.

Invalidates all kinds of non-smart molecule references including MoleculeRef, MoleculeRefSpan and MoleculeSelection

proxy::MoleculeRef xmol::Frame::add_molecule()

Add new molecules at the end of frame and return reference to it.

Invalidates all kinds of non-smart molecule references including MoleculeRef, MoleculeRefSpan and MoleculeSelection

Appropriate reserve_molecules() call prevents references invalidation