|
libbio
|
#include <Linear.h>

Public Member Functions | |
| Linear (Pointer< Identifiable< Id > > component, bool shared=true, ::std::ptrdiff_t derivedOffset=0) | |
| Linear (const Linear &toCopy) | |
| ~Linear () | |
| bool | operator== (Pointer< const Identifiable< Id > > component) const |
| bool | operator== (const Linear &other) const |
| operator Pointer< Identifiable< Id > > () | |
| operator Pointer< const Identifiable< Id > > () const | |
| Identifiable< Id > & | operator* () |
| const Identifiable< Id > & | operator* () const |
| Pointer< Identifiable< Id > > | operator-> () |
| Pointer< const Identifiable< Id > > | operator-> () const |
| template<typename T > | |
| T | As () const |
| ::std::ptrdiff_t | GetDerivedOffset () const |
| void | SetDerivedOffset (::std::ptrdiff_t offset) |
| bool | IsShared () const |
| void | SetShared (bool shouldShare) |
Protected Attributes | |
| Pointer< Identifiable< Id > > | mComponent |
| bool | mShared |
| ::std::ptrdiff_t | mDerivedOffset |
Linear is a ____pointer interface for Biology.
This class is used by Line and chemical::LinearMotifs, see those classes for more info.
Lines contain logic for handling their CONTENT_TYPE by Id, Name, and other potentials innate to the Identifiable<Id>. The term "linear" comes from the idea that instead of a 0 dimensional pile of objects, as are Arrangements, *this can be ordered along at least 1 dimension (i.e. the Id).
Current features:
Future features:
NOTE: Linear is NOT VIRTUAL!
This is done to save space in lists. Because we do not need a vtable, we shan't have one!
NOTE: we should support Dimensions other than the Id. However, the limitations of chemical::Atom::Bonds prevent us from indexing more than 1 template variable from ____Interfaces (e.g. Structure).
Id here, mirrors what is used by chemical::Class and does not require any additional template specialization.
Plus, not supporting other Dimensions makes for cleaner inheritance / downstream code.
Support for other Dimensions may be added in a future release.
NOTE: Linear wrappers are Shared by default to avoid destructive action by temporaries.
Sharing should be removed when undesired.
| bio::physical::Linear::Linear | ( | Pointer< Identifiable< Id > > | component, |
| bool | shared = true, |
||
| ::std::ptrdiff_t | derivedOffset = 0 |
||
| ) |
| component | |
| shared |
NOTE: This sets mShared to true!
| toCopy |
| bio::physical::Linear::~Linear | ( | ) |
Will delete mComponent iff !mShared.
|
inline |
| bool bio::physical::Linear::IsShared | ( | ) | const |
| bio::physical::Linear::operator Pointer< const Identifiable< Id > > | ( | ) | const |
| bio::physical::Linear::operator Pointer< Identifiable< Id > > | ( | ) |
| Identifiable< Id > & bio::physical::Linear::operator* | ( | ) |
| const Identifiable< Id > & bio::physical::Linear::operator* | ( | ) | const |
| Pointer< Identifiable< Id > > bio::physical::Linear::operator-> | ( | ) |
| Pointer< const Identifiable< Id > > bio::physical::Linear::operator-> | ( | ) | const |
NOTE: Comparison should be handled by Identifiable, i.e. by Id.
| other |
| bool bio::physical::Linear::operator== | ( | Pointer< const Identifiable< Id > > | component | ) | const |
NOTE: Comparison should be handled by Identifiable, i.e. by Id.
| component |
|
inline |
Update the stored derived-pointer offset.
| offset | bytes from Identifiable* to the original pointer type. |
Sets mShared in *this.
| shouldShare |
|
protected |
|
protected |
|
protected |