COPASI API  4.40.278
CTableRow Class Reference

#include <CTableCell.h>

Public Member Functions

 CTableRow (const CTableRow &src)
 
 CTableRow (const size_t &size=0, const char &separator='\t')
 
const std::vector< CTableCell > & getCells () const
 
const size_t & getLastFilledCell () const
 
size_t guessColumnNumber (std::istream &is, const bool &rewind)
 
const bool & isEmpty () const
 
bool resize (const size_t &size)
 
size_t size () const
 
 ~CTableRow ()
 

Private Member Functions

std::istream & readLine (std::istream &is)
 

Private Attributes

std::vector< CTableCellmCells
 
bool mIsEmpty
 
size_t mLastFilledCell
 
char mSeparator
 

Friends

std::istream & operator>> (std::istream &is, CTableRow &cell)
 

Constructor & Destructor Documentation

◆ CTableRow() [1/2]

CTableRow::CTableRow ( const size_t &  size = 0,
const char &  separator = '\t' 
)

Default constructor

Parameters
constunisgned C_INT32 & size (default: 0)
constchar & separator (default: '\t')

References resize(), and size().

◆ CTableRow() [2/2]

CTableRow::CTableRow ( const CTableRow src)

Copy constructor

Parameters
constCTableRow & src

◆ ~CTableRow()

CTableRow::~CTableRow ( )

Destructor

Member Function Documentation

◆ getCells()

const std::vector< CTableCell > & CTableRow::getCells ( ) const

Retrieve the cells.

Returns
const std::vector< CTableCell > & cells

References mCells.

Referenced by CExperiment::read(), and CExperiment::readColumnNames().

◆ getLastFilledCell()

const size_t & CTableRow::getLastFilledCell ( ) const

Retrieve the index of the last non empty cell in the last read operation. @const size_t & lastFilledCell

References mLastFilledCell.

◆ guessColumnNumber()

size_t CTableRow::guessColumnNumber ( std::istream &  is,
const bool &  rewind 
)

Try to guess the number of columns in the current line

Parameters
std::istream&is
constbool & rewind
Returns
size_t numColumns

References C_INVALID_INDEX, isEmpty(), and mCells.

Referenced by CExperiment::guessColumnNumber().

◆ isEmpty()

const bool & CTableRow::isEmpty ( ) const

Check whether row contains any cells with data A row is considered empty when it all cells are empty.

References mIsEmpty.

Referenced by guessColumnNumber().

◆ readLine()

std::istream & CTableRow::readLine ( std::istream &  is)
private

Fill the row with data from the inpute stream until End_Of_Line is encountered and advance the stream accordingly.

Parameters
std::istream& is
Returns
std::istream & is

References C_INT, C_INVALID_INDEX, mCells, mIsEmpty, mLastFilledCell, and mSeparator.

◆ resize()

bool CTableRow::resize ( const size_t &  size)

Resize

Parameters
constsize_t & size
Returns
bool success

References mCells, mSeparator, and size().

Referenced by CTableRow().

◆ size()

size_t CTableRow::size ( ) const

Retrieve the size of the row

Returns
const size_t size

References mCells.

Referenced by CTableRow(), and resize().

Friends And Related Function Documentation

◆ operator>>

std::istream& operator>> ( std::istream &  is,
CTableRow cell 
)
friend

Formated stream input operator

Parameters
CTableRow& cell
Returns
std::istream &

Member Data Documentation

◆ mCells

std::vector< CTableCell > CTableRow::mCells
private

◆ mIsEmpty

bool CTableRow::mIsEmpty
private

Referenced by isEmpty(), and readLine().

◆ mLastFilledCell

size_t CTableRow::mLastFilledCell
private

Referenced by getLastFilledCell(), and readLine().

◆ mSeparator

char CTableRow::mSeparator
private

Referenced by readLine(), and resize().


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