|
libbio
|
#include <Bond.h>
Public Member Functions | |
| Bond () | |
| Bond (AtomicNumber id, Pointer< physical::Wave > bonded, BondType type=bond_type::Unknown()) | |
| Bond (AtomicNumber id, Pointer< physical::Wave > bonded, BondType type, bool ownsBonded) | |
| ~Bond () | |
| bool | operator== (const AtomicNumber id) const |
| bool | operator== (const Bond &other) const |
| bool | Form (AtomicNumber id, Pointer< physical::Wave > bonded, BondType type=bond_type::Unknown()) |
| bool | Form (AtomicNumber id, Pointer< physical::Wave > bonded, BondType type, bool ownsBonded) |
| AtomicNumber | GetId () const |
| Pointer< physical::Wave > | GetBonded () |
| Pointer< const physical::Wave > | GetBonded () const |
| Pointer< physical::Wave > | DetachBondedForWrite () |
| bool | IsBondedShared () const |
| bool | IsBondedOwned () const |
| BondType | GetType () const |
| bool | OwnsBonded () const |
| bool | IsEmpty () const |
| void | Break () |
Bonds are used by Atom to form relationships to Waves.
These can be thought of as edges in a directed graph.
See Atom.h for more info.
NOTE: Bonds may currently only be of a single BondType. This may change in a future release.
| bio::chemical::Bond::Bond | ( | ) |
| bio::chemical::Bond::Bond | ( | AtomicNumber | id, |
| Pointer< physical::Wave > | bonded, | ||
| BondType | type = bond_type::Unknown() |
||
| ) |
| id | |
| bonded | |
| type |
| bio::chemical::Bond::Bond | ( | AtomicNumber | id, |
| Pointer< physical::Wave > | bonded, | ||
| BondType | type, | ||
| bool | ownsBonded | ||
| ) |
| bio::chemical::Bond::~Bond | ( | ) |
| void bio::chemical::Bond::Break | ( | ) |
Empties the contents of *this.
| Pointer< physical::Wave > bio::chemical::Bond::DetachBondedForWrite | ( | ) |
COPY-ON-WRITE detach: if mBonded is an owning reference shared with another bond (e.g. a COW-shared clone), deep-copy it (via physical::Wave::Clone()) into a private owned reference and re-point *this at the copy; then return the now uniquely-owned bonded for mutation. A unique owning bond is mutated in place (no copy). A borrowed bond is never detached (the real owner manages it) — its raw bonded is returned as-is. The CALLER MUST hold the host Atom's EXCLUSIVE lock (this re-points the bond's storage). RFC_BONDED_COW_HANDLE §12.
| bool bio::chemical::Bond::Form | ( | AtomicNumber | id, |
| Pointer< physical::Wave > | bonded, | ||
| BondType | type, | ||
| bool | ownsBonded | ||
| ) |
| bool bio::chemical::Bond::Form | ( | AtomicNumber | id, |
| Pointer< physical::Wave > | bonded, | ||
| BondType | type = bond_type::Unknown() |
||
| ) |
Update the contents of *this.
Only works if *this IsEmpty().
| id | |
| bonded | |
| type |
| Pointer< physical::Wave > bio::chemical::Bond::GetBonded | ( | ) |
| Pointer< const physical::Wave > bio::chemical::Bond::GetBonded | ( | ) | const |
| AtomicNumber bio::chemical::Bond::GetId | ( | ) | const |
| BondType bio::chemical::Bond::GetType | ( | ) | const |
| bool bio::chemical::Bond::IsBondedOwned | ( | ) | const |
| bool bio::chemical::Bond::IsBondedShared | ( | ) | const |
1) — i.e. a mutable access must copy-on-write detach it. Borrowed and uniquely owned bonds return false: they are mutated in place, no detach (and so need no exclusive lock). RFC_BONDED_COW_HANDLE §12.
| bool bio::chemical::Bond::IsEmpty | ( | ) | const |
| bool bio::chemical::Bond::operator== | ( | const AtomicNumber | id | ) | const |
| id |
| other |
| bool bio::chemical::Bond::OwnsBonded | ( | ) | const |