vg
tools for working with variation graphs
Public Member Functions | Public Attributes | List of all members
vg::SnarlManager::SnarlRecord Struct Reference

Public Member Functions

SnarlRecordoperator= (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< Chainchild_chains
 This holds chains over the child snarls. More...
 
const Snarlparent = nullptr
 
Chainparent_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
 

Detailed Description

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.

Member Function Documentation

◆ operator=()

SnarlRecord& vg::SnarlManager::SnarlRecord::operator= ( const Snarl other)
inline

Allow assignment from a Snarl object, fluffing it up into a full SnarlRecord.

Member Data Documentation

◆ child_chains

deque<Chain> vg::SnarlManager::SnarlRecord::child_chains

This holds chains over the child snarls.

◆ children

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.

◆ parent

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.

◆ parent_chain

Chain* vg::SnarlManager::SnarlRecord::parent_chain = nullptr

This points to the chain we are in, or null if we are not in a chain.

◆ parent_chain_index

size_t vg::SnarlManager::SnarlRecord::parent_chain_index = 0

And this is what index we are at in the chain;.

◆ snarl

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.

◆ snarl_number

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


The documentation for this struct was generated from the following file: