vg
tools for working with variation graphs
|
Public Member Functions | |
SnarlRecord & | operator= (const Snarl &other) |
Allow assignment from a Snarl object, fluffing it up into a full SnarlRecord. More... | |
Public Attributes | |
Snarl | snarl |
vector< const Snarl * > | children |
deque< Chain > | child_chains |
This holds chains over the child snarls. More... | |
const Snarl * | parent = nullptr |
Chain * | parent_chain = nullptr |
This points to the chain we are in, or null if we are not in a chain. More... | |
size_t | parent_chain_index = 0 |
And this is what index we are at in the chain;. More... | |
size_t | snarl_number |
To support the Snarl*-driven API, we use a struct that lays out a snarl followed by indexing metadata, one after the other in memory. We can just cast a Snarl* to a pointer to one of these to get access to all the metadata.
|
inline |
Allow assignment from a Snarl object, fluffing it up into a full SnarlRecord.
deque<Chain> vg::SnarlManager::SnarlRecord::child_chains |
This holds chains over the child snarls.
vector<const Snarl*> vg::SnarlManager::SnarlRecord::children |
This is a vector of pointers into the master snarl container at children. We know the pointers are to valid SnarlRecords. A SnarlRecord does not own its children.
const Snarl* vg::SnarlManager::SnarlRecord::parent = nullptr |
This points to the parent SnarlRecord (as a snarl), or null if we are a root snarl or have not been told of our parent yet.
Chain* vg::SnarlManager::SnarlRecord::parent_chain = nullptr |
This points to the chain we are in, or null if we are not in a chain.
size_t vg::SnarlManager::SnarlRecord::parent_chain_index = 0 |
And this is what index we are at in the chain;.
Snarl vg::SnarlManager::SnarlRecord::snarl |
With recent Protobuf, we can't inherit from Protobuf generated classes, so we rely on the first member here being at offset 0. This is achieved by making sure SnarlRecord is aligned like Snarl.
size_t vg::SnarlManager::SnarlRecord::snarl_number |
This holds the index of the SnarlRecord* in the deque We are doing this because a deque is not contiguous and the index lookup using a SnarlRecord* isn't easily derivable