Gamgee
You miserable little maggot. I'll stove your head in!
|
Helper class for VariantBuilder to manage the storage and encoding of a single multi-sample individual field. More...
#include <variant_builder_individual_field.h>
Public Member Functions | |
VariantBuilderIndividualField (const uint32_t num_samples, const uint32_t field_index, const int32_t field_type, const ENCODED_TYPE missing_value, const ENCODED_TYPE end_of_vector_value, const uint32_t short_value_upper_bound) | |
VariantBuilderIndividualField (VariantBuilderIndividualField &&other)=default | |
VariantBuilderIndividualField & | operator= (VariantBuilderIndividualField &&other)=default |
VariantBuilderIndividualField (const VariantBuilderIndividualField &other)=delete | |
VariantBuilderIndividualField & | operator= (const VariantBuilderIndividualField &other)=delete |
~VariantBuilderIndividualField ()=default | |
void | set_entire_field (std::vector< BULK_CHANGE_TYPE > &&bulk_changes) |
void | set_entire_field (const std::vector< BULK_CHANGE_TYPE > &bulk_changes) |
void | set_entire_field (std::vector< std::vector< BULK_CHANGE_TYPE >> &&bulk_changes) |
void | set_entire_field (const std::vector< std::vector< BULK_CHANGE_TYPE >> &bulk_changes) |
void | set_sample_field_value (const uint32_t sample_index, const ENCODED_TYPE *values, const uint32_t num_values) |
Stores a value for just a single sample efficiently using the ShortValueOptimizedStorage layer. More... | |
uint32_t | field_index () const |
int32_t | field_type () const |
void | remove () |
bool | removed () const |
bool | missing () const |
bool | present () const |
bool | has_bulk_changes () const |
bool | has_per_sample_changes () const |
void | clear () |
Reset this field to a pristine state with no data. More... | |
uint32_t | estimated_encoded_size () const |
Provide an estimate (typically an overestimate) of the number of bytes this field will require when encoded. More... | |
void | encode_into (kstring_t *destination) const |
Encode this field's data into the provided buffer. If field has no data or was removed, do nothing. More... | |
Helper class for VariantBuilder to manage the storage and encoding of a single multi-sample individual field.
Prior to build time, field data is stored in un-encoded form in one of two ways:
-in vectors moved or copied from the user (these represent bulk changes to the entire field)
-in ShortValueOptimizedStorage when there are per-sample changes – this allows us to efficiently handle the setting of many small per-sample values without performing any extra dynamic memory allocation most of the time
There cannot be both bulk and per-sample changes – this is treated as an error, since it would be far too expensive to reconcile the two.
At build time, the raw, un-encoded field data is passed to htslib for encoding into the final byte array for insertion into a Variant object.
|
inlineexplicit |
|
default |
|
delete |
|
default |
|
inline |
Reset this field to a pristine state with no data.
|
inline |
Encode this field's data into the provided buffer. If field has no data or was removed, do nothing.
|
inline |
Provide an estimate (typically an overestimate) of the number of bytes this field will require when encoded.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
default |
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |
Bulk setters, allowing field to be set for all samples using one- or two-dimensional vectors, and by move or by copy
|
inline |
|
inline |
|
inline |
|
inline |
Stores a value for just a single sample efficiently using the ShortValueOptimizedStorage layer.