ENERGY MONITOR 0.2
Loading...
Searching...
No Matches
dataTable< HELD_DATA > Class Template Reference

#include <dataTable.h>

Public Member Functions

unsigned int get_row_num ()
 
unsigned int get_col_num ()
 
void insertData (HELD_DATA d, unsigned int row, unsigned int col)
 inserts a value to a cell of dataTable instance with that address
 
HELD_DATA getData (int row, int col) const
 return the data at some address
 
void eraseRow (int start_row, int rows_num=1)
 entirely deletes the rows and frees their memory
 
void eraseColumn (int start_col, int cols_num=1)
 entirely deletes colunms and frees thier memory while keeping order
 
void refresh ()
 refreshes the data Table for any mistake probability or bad handling
 
bool extractRow (unsigned int rowNumber, std::vector< HELD_DATA > &returnArray)
 Extracts a row from the dataTable in a vector.
 
bool extractColumn (unsigned int columnNumber, std::vector< HELD_DATA > &returnArray)
 Extracts a row from the dataTable in a vector.
 
bool insertRow (unsigned int rowNumber, const std::vector< HELD_DATA > &putArray)
 inserts a row in the table replacing existing if they exist or adds them
 
bool insertColumn (unsigned int columnNumber, const std::vector< HELD_DATA > &putArray)
 inserts a column in the table replacing existing if they exist or adds them
 
bool sub_table (dataTable &subTable, int rowStart, int rowEnd, int columnStart, int columnEnd)
 EXTRACT A SUBSET OF THE BIGGER TABLE.
 

Detailed Description

template<typename HELD_DATA>
class dataTable< HELD_DATA >

Definition at line 29 of file dataTable.h.

Member Function Documentation

◆ eraseColumn()

template<typename HELD_DATA >
void dataTable< HELD_DATA >::eraseColumn ( int start_col,
int cols_num = 1 )
inline

entirely deletes colunms and frees thier memory while keeping order

Parameters
start_colthe column to start deleting from
cols_numhow many columns to keep deleting after the start row

Definition at line 86 of file dataTable.h.

◆ eraseRow()

template<typename HELD_DATA >
void dataTable< HELD_DATA >::eraseRow ( int start_row,
int rows_num = 1 )
inline

entirely deletes the rows and frees their memory

Parameters
start_rowthe row to start deleting from
rows_numhow many rows to keep deleting after the start row

Definition at line 74 of file dataTable.h.

◆ extractColumn()

template<typename HELD_DATA >
bool dataTable< HELD_DATA >::extractColumn ( unsigned int columnNumber,
std::vector< HELD_DATA > & returnArray )
inline

Extracts a row from the dataTable in a vector.

Parameters
rowNumberthe row number of the row you want to extract starting from 0
returnArraythe vector the row is returned in
Returns
boolean for success of operation

Definition at line 129 of file dataTable.h.

◆ extractRow()

template<typename HELD_DATA >
bool dataTable< HELD_DATA >::extractRow ( unsigned int rowNumber,
std::vector< HELD_DATA > & returnArray )
inline

Extracts a row from the dataTable in a vector.

Parameters
rowNumberthe row number of the row you want to extract starting from 0
returnArraythe vector the row is returned in
Returns
boolean for success of operation

Definition at line 114 of file dataTable.h.

◆ get_col_num()

template<typename HELD_DATA >
unsigned int dataTable< HELD_DATA >::get_col_num ( )
inline

Definition at line 41 of file dataTable.h.

◆ get_row_num()

template<typename HELD_DATA >
unsigned int dataTable< HELD_DATA >::get_row_num ( )
inline

Definition at line 38 of file dataTable.h.

◆ getData()

template<typename HELD_DATA >
HELD_DATA dataTable< HELD_DATA >::getData ( int row,
int col ) const
inline

return the data at some address

Parameters
rowthe row number of data you want
colcolumn number of this data
Returns
the data you want

Definition at line 64 of file dataTable.h.

◆ insertColumn()

template<typename HELD_DATA >
bool dataTable< HELD_DATA >::insertColumn ( unsigned int columnNumber,
const std::vector< HELD_DATA > & putArray )
inline

inserts a column in the table replacing existing if they exist or adds them

Parameters
rowNumberthe position of the column to be added
putArraythe vector that holds the data to be put
Returns
boolean for success of operation

Definition at line 153 of file dataTable.h.

◆ insertData()

template<typename HELD_DATA >
void dataTable< HELD_DATA >::insertData ( HELD_DATA d,
unsigned int row,
unsigned int col )
inline

inserts a value to a cell of dataTable instance with that address

Definition at line 46 of file dataTable.h.

◆ insertRow()

template<typename HELD_DATA >
bool dataTable< HELD_DATA >::insertRow ( unsigned int rowNumber,
const std::vector< HELD_DATA > & putArray )
inline

inserts a row in the table replacing existing if they exist or adds them

Parameters
rowNumberthe position of the row to be added
putArraythe vector that holds the data to be put
Returns
boolean for success of operation

Definition at line 142 of file dataTable.h.

◆ refresh()

template<typename HELD_DATA >
void dataTable< HELD_DATA >::refresh ( )
inline

refreshes the data Table for any mistake probability or bad handling

Definition at line 95 of file dataTable.h.

◆ sub_table()

template<typename HELD_DATA >
bool dataTable< HELD_DATA >::sub_table ( dataTable< HELD_DATA > & subTable,
int rowStart,
int rowEnd,
int columnStart,
int columnEnd )
inline

EXTRACT A SUBSET OF THE BIGGER TABLE.

Parameters
subTableTHE TABLE WE PASS THE EXTRACTED DATA TO
rowStartthe start row for the extraction
rowEndthe end row for the extraction
columnStartthe start column for the extraction
columnEndthe end column for the extraction
Returns
true if the extraction was in bounds .ie subTable bounds is subset of the table else return false

Definition at line 172 of file dataTable.h.


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