vg
tools for working with variation graphs
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
vg::ZipCodeTree::tree_item_t Struct Reference

One item in the zip code tree, representing a node or edge of the tree. More...

#include <zip_code_tree.hpp>

Public Member Functions

 tree_item_t ()
 Empty constructor. More...
 
 tree_item_t (tree_item_type_t type, size_t raw_value, bool is_reversed_or_cyclic)
 Constructor so that value gets set properly. More...
 
 tree_item_t (tree_item_type_t type, size_t raw_value)
 Constructor to set a "false" for is_reversed_or_cyclic. More...
 
 tree_item_t (tree_item_type_t type, bool is_reversed_or_cyclic)
 Constructor to set max for the value. More...
 
 tree_item_t (tree_item_type_t type)
 Constructor for just a type. More...
 
void set_value (size_t new_value)
 
void set_section_length (size_t new_length)
 
tree_item_type_t get_type () const
 
size_t get_value () const
 
bool get_is_reversed () const
 
bool get_is_cyclic () const
 
size_t get_section_length () const
 
int64_t get_other_bound_offset () const
 
void set_is_cyclic (bool is_cyclic)
 

Static Private Member Functions

static size_t internal_max ()
 

Private Attributes

tree_item_type_t type: 4
 Is this a seed, boundary, or an edge. More...
 
size_t value: 59
 
size_t section_length: 59
 
bool is_reversed_or_cyclic
 

Detailed Description

One item in the zip code tree, representing a node or edge of the tree.

Constructor & Destructor Documentation

◆ tree_item_t() [1/5]

vg::ZipCodeTree::tree_item_t::tree_item_t ( )
inline

Empty constructor.

◆ tree_item_t() [2/5]

vg::ZipCodeTree::tree_item_t::tree_item_t ( tree_item_type_t  type,
size_t  raw_value,
bool  is_reversed_or_cyclic 
)
inline

Constructor so that value gets set properly.

◆ tree_item_t() [3/5]

vg::ZipCodeTree::tree_item_t::tree_item_t ( tree_item_type_t  type,
size_t  raw_value 
)
inline

Constructor to set a "false" for is_reversed_or_cyclic.

◆ tree_item_t() [4/5]

vg::ZipCodeTree::tree_item_t::tree_item_t ( tree_item_type_t  type,
bool  is_reversed_or_cyclic 
)
inline

Constructor to set max for the value.

◆ tree_item_t() [5/5]

vg::ZipCodeTree::tree_item_t::tree_item_t ( tree_item_type_t  type)
inline

Constructor for just a type.

Member Function Documentation

◆ get_is_cyclic()

bool vg::ZipCodeTree::tree_item_t::get_is_cyclic ( ) const
inline

Is this bound part of a cyclic snarl? Uses is_reversed_or_cyclic Only call on a bound

◆ get_is_reversed()

bool vg::ZipCodeTree::tree_item_t::get_is_reversed ( ) const
inline

Is this seed reversed in the tree? Uses is_reversed_or_cyclic Only call on a SEED

◆ get_other_bound_offset()

int64_t vg::ZipCodeTree::tree_item_t::get_other_bound_offset ( ) const
inline

What to add or subtract to this thing's index to get index of other bound

◆ get_section_length()

size_t vg::ZipCodeTree::tree_item_t::get_section_length ( ) const
inline

◆ get_type()

tree_item_type_t vg::ZipCodeTree::tree_item_t::get_type ( ) const
inline

◆ get_value()

size_t vg::ZipCodeTree::tree_item_t::get_value ( ) const
inline

◆ internal_max()

static size_t vg::ZipCodeTree::tree_item_t::internal_max ( )
inlinestaticprivate

The maximum value of internal fields; this corresponds to std::numeric_limits<size_t>::max() outside

◆ set_is_cyclic()

void vg::ZipCodeTree::tree_item_t::set_is_cyclic ( bool  is_cyclic)
inline

◆ set_section_length()

void vg::ZipCodeTree::tree_item_t::set_section_length ( size_t  new_length)
inline

◆ set_value()

void vg::ZipCodeTree::tree_item_t::set_value ( size_t  new_value)
inline

Member Data Documentation

◆ is_reversed_or_cyclic

bool vg::ZipCodeTree::tree_item_t::is_reversed_or_cyclic
private

For a seed, if we're walking through the tree from right to left (the default), will we traverse this position backwards? Or, for a bound is the snarl or parent snarl cyclic? Ignored for EDGE/CHAIN_COUNT and should be set to false

◆ section_length

size_t vg::ZipCodeTree::tree_item_t::section_length
private

For a bound, how long the internal section is e.g. a chain with one seed would be "1"

◆ type

tree_item_type_t vg::ZipCodeTree::tree_item_t::type
private

Is this a seed, boundary, or an edge.

◆ value

size_t vg::ZipCodeTree::tree_item_t::value
private

For a seed, the index into seeds For an edge, the distance value For a snarl or child chain bound, distance to the snarl start For example, (1 0 0 0 [seed]) would have 0 for the snarl start, 5 for the chain start, 7 for the chain end, and 8 for the snarl end


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