Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
hgps::core::PrimitiveDataTableColumnBuilder< ColumnType > Class Template Reference

Primitive data type DataTable column builder class. More...

#include <column_builder.h>

Public Types

using value_type = typename ColumnType::value_type
 

Public Member Functions

 PrimitiveDataTableColumnBuilder ()=delete
 
 PrimitiveDataTableColumnBuilder (std::string name)
 Initialise a new instance of the PrimitiveDataTableColumnBuilder class. More...
 
std::string name () const
 Gets the column name. More...
 
std::size_t size () const
 Gets the column data size. More...
 
std::size_t null_count () const
 Gets the number of null values in the column data. More...
 
std::size_t capacity () const
 Gets the builder data capacity. More...
 
void reserve (std::size_t capacity)
 Reserve builder storage capacity. More...
 
void append_null ()
 Append a single null value. More...
 
void append_null (const std::size_t count)
 Append multiple null values. More...
 
void append (const value_type value)
 
value_type value (std::size_t index) const
 Gets the column value at a given index, no boundary checks. More...
 
value_type operator[] (std::size_t index) const
 Gets the column value at a given index, no boundary checks. More...
 
value_typeoperator[] (std::size_t index)
 Gets the column value at a given index, no boundary checks. More...
 
void reset ()
 Resets the column builder data. More...
 
std::unique_ptr< ColumnType > build ()
 Builds the column with current data. More...
 

Detailed Description

template<typename ColumnType>
class hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >

Primitive data type DataTable column builder class.

Template Parameters
ColumnType

Member Typedef Documentation

◆ value_type

template<typename ColumnType >
using hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::value_type = typename ColumnType::value_type

Constructor & Destructor Documentation

◆ PrimitiveDataTableColumnBuilder() [1/2]

template<typename ColumnType >
hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::PrimitiveDataTableColumnBuilder ( )
delete

◆ PrimitiveDataTableColumnBuilder() [2/2]

template<typename ColumnType >
hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::PrimitiveDataTableColumnBuilder ( std::string  name)
inlineexplicit

Initialise a new instance of the PrimitiveDataTableColumnBuilder class.

Parameters
nameThe column name

Member Function Documentation

◆ append()

template<typename ColumnType >
void hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::append ( const value_type  value)
inline
Here is the call graph for this function:

◆ append_null() [1/2]

template<typename ColumnType >
void hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::append_null ( )
inline

Append a single null value.

◆ append_null() [2/2]

template<typename ColumnType >
void hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::append_null ( const std::size_t  count)
inline

Append multiple null values.

Parameters
countThe number of null values to append

◆ build()

template<typename ColumnType >
std::unique_ptr<ColumnType> hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::build ( )
inline

Builds the column with current data.

Returns
The new column instance
Here is the caller graph for this function:

◆ capacity()

template<typename ColumnType >
std::size_t hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::capacity ( ) const
inline

Gets the builder data capacity.

Returns
Current capacity
Here is the caller graph for this function:

◆ name()

template<typename ColumnType >
std::string hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::name ( ) const
inline

Gets the column name.

Returns
Column name

◆ null_count()

template<typename ColumnType >
std::size_t hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::null_count ( ) const
inline

Gets the number of null values in the column data.

Returns
Column null values count

◆ operator[]() [1/2]

template<typename ColumnType >
value_type& hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::operator[] ( std::size_t  index)
inline

Gets the column value at a given index, no boundary checks.

Parameters
indexColumn index
Returns
The value at index, if inside bounds; otherwise, undefined behaviour.

◆ operator[]() [2/2]

template<typename ColumnType >
value_type hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::operator[] ( std::size_t  index) const
inline

Gets the column value at a given index, no boundary checks.

Parameters
indexColumn index
Returns
The value at index, if inside bounds; otherwise, undefined behaviour.
Here is the call graph for this function:

◆ reserve()

template<typename ColumnType >
void hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::reserve ( std::size_t  capacity)
inline

Reserve builder storage capacity.

Parameters
capacitynew capacity, in number of elements
Here is the call graph for this function:

◆ reset()

template<typename ColumnType >
void hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::reset ( )
inline

Resets the column builder data.

◆ size()

template<typename ColumnType >
std::size_t hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::size ( ) const
inline

Gets the column data size.

Returns
Column size

◆ value()

template<typename ColumnType >
value_type hgps::core::PrimitiveDataTableColumnBuilder< ColumnType >::value ( std::size_t  index) const
inline

Gets the column value at a given index, no boundary checks.

Parameters
indexColumn index
Returns
The value at index, if inside bounds; otherwise, undefined behaviour.
Here is the caller graph for this function:

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