Represents a block of Cells
.
More...
#include <CellBlock.h>
Public Member Functions | |
CellBlock () | |
Initializes a newly created CellBlock object with default attributes. | |
CellBlock (std::string id) | |
Initializes a newly created CellBlock object with a study identifier. | |
CellBlock (std::vector< Cell >::iterator begin, std::vector< Cell >::iterator end) | |
Initializes a newly created CellBlock object with the cell vector specified by the input parameters. | |
CellBlock (std::list< Cell >::iterator begin, std::list< Cell >::iterator end) | |
Initializes a newly created CellBlock object with the cell list specified by the input parameters. | |
CellBlock (std::string id, std::vector< Cell >::iterator begin, std::vector< Cell >::iterator end) | |
Initializes a newly created CellBlock object with the study identifier and the cell vector specified by the input parameters. | |
CellBlock (std::string id, std::list< Cell >::iterator begin, std::list< Cell >::iterator end) | |
Initializes a newly created CellBlock object with the study identifier and the cell list specified by the input parameters. | |
virtual | ~CellBlock () |
Destructor. | |
void | addCell (const Cell &cell) |
Add a Cell to the block. | |
bool | addCells (std::vector< Cell >::iterator begin, std::vector< Cell >::iterator end) |
Add a collection of Cells to the block. | |
bool | addCells (std::list< Cell >::iterator begin, std::list< Cell >::iterator end) |
Add a collection of Cells to the block. | |
bool | removeCells (uint64_t numCellsToRemove) |
Remove cells from the end of the block. | |
Cell | getCell (uint64_t index) const |
Return a cell from the block. | |
void | clearCells () |
Remove all cells from the block. | |
uint64_t | size () const |
Return the number of cells in the block. | |
bool | isEmpty () const |
Return true if the block contains no cells. | |
virtual std::string | toString () |
Return a string representation of this CellBlock . | |
Private Member Functions | |
CellBlock (const CellBlock &rhs) | |
Copy constructor - NOT IMPLEMENTED. | |
CellBlock & | operator= (const CellBlock &rhs) |
Assignment operator - NOT IMPLEMENTED. |
Represents a block of Cells
.
Definition at line 20 of file CellBlock.h.
CellBlock::CellBlock | ( | ) |
Initializes a newly created CellBlock
object with default attributes.
Definition at line 9 of file CellBlock.cpp.
References Yosokumo::Block::CELL, and Yosokumo::Block::setType().
CellBlock::CellBlock | ( | std::string | id | ) |
Initializes a newly created CellBlock
object with a study identifier.
id | a study identifier for the block. |
Definition at line 14 of file CellBlock.cpp.
References Yosokumo::Block::CELL, and Yosokumo::Block::setType().
Initializes a newly created CellBlock
object with the cell vector specified by the input parameters.
begin | an iterator specifying the beginning of the cell vector. | |
end | an iterator specifying the end of the cell vector. |
Definition at line 19 of file CellBlock.cpp.
References addCells(), Yosokumo::Block::CELL, and Yosokumo::Block::setType().
Initializes a newly created CellBlock
object with the cell list specified by the input parameters.
begin | an iterator specifying the beginning of the cell list. | |
end | an iterator specifying the end of the cell list. |
Definition at line 27 of file CellBlock.cpp.
References addCells(), Yosokumo::Block::CELL, and Yosokumo::Block::setType().
CellBlock::CellBlock | ( | std::string | id, | |
std::vector< Cell >::iterator | begin, | |||
std::vector< Cell >::iterator | end | |||
) |
Initializes a newly created CellBlock
object with the study identifier and the cell vector specified by the input parameters.
id | a study identifier for the block. | |
begin | an iterator specifying the beginning of the cell vector. | |
end | an iterator specifying the end of the cell vector. |
Definition at line 35 of file CellBlock.cpp.
References addCells(), Yosokumo::Block::CELL, and Yosokumo::Block::setType().
CellBlock::CellBlock | ( | std::string | id, | |
std::list< Cell >::iterator | begin, | |||
std::list< Cell >::iterator | end | |||
) |
Initializes a newly created CellBlock
object with the study identifier and the cell list specified by the input parameters.
id | a study identifier for the block. | |
begin | an iterator specifying the beginning of the cell list. | |
end | an iterator specifying the end of the cell list. |
Definition at line 44 of file CellBlock.cpp.
References addCells(), Yosokumo::Block::CELL, and Yosokumo::Block::setType().
CellBlock::~CellBlock | ( | ) | [virtual] |
Destructor.
Definition at line 53 of file CellBlock.cpp.
Yosokumo::CellBlock::CellBlock | ( | const CellBlock & | rhs | ) | [private] |
Copy constructor - NOT IMPLEMENTED.
void CellBlock::addCell | ( | const Cell & | cell | ) |
Add a Cell
to the block.
The cell parameter is appended to the end of the cell sequence.
cell | the Cell to add to the block. |
Definition at line 59 of file CellBlock.cpp.
References Yosokumo::Block::cellSequence.
Referenced by Yosokumo::YosokumoProtobuf::makeBlockFromProtobufBlock().
Add a collection of Cells
to the block.
The Cells
in the list specified by the parameters are appended to the end of the cell sequence.
begin | an iterator specifying the beginning of the cell list to add to the block. | |
end | an iterator specifying the end of the cell list to add to the block. |
Definition at line 73 of file CellBlock.cpp.
References Yosokumo::Block::cellSequence.
Add a collection of Cells
to the block.
The Cells
in the vector specified by the parameters are appended to the end of the cell sequence.
begin | an iterator specifying the beginning of the cell vector to add to the block. | |
end | an iterator specifying the end of the cell vector to add to the block. |
Definition at line 64 of file CellBlock.cpp.
References Yosokumo::Block::cellSequence.
Referenced by CellBlock().
void CellBlock::clearCells | ( | ) |
Remove all cells from the block.
After a call of this method, the sequence is empty, i.e., it contains no cells.
Definition at line 104 of file CellBlock.cpp.
References Yosokumo::Block::cellSequence.
Referenced by removeCells().
Cell CellBlock::getCell | ( | uint64_t | index | ) | const |
Return a cell from the block.
This makes it possible to iterate over all cells in the sequence like this:
for (uint64_t i = 0; i < cellSequence.size(); ++i) { Cell c = cellSequence.getCell(i) process cell c }
index | specifying the cell of the 0-based block. |
Cell
at the location specified by the index. Definition at line 98 of file CellBlock.cpp.
References Yosokumo::Block::cellSequence.
Referenced by toString().
bool CellBlock::isEmpty | ( | ) | const |
Return true
if the block contains no cells.
true
if the block contains no cells. false
otherwise. Definition at line 114 of file CellBlock.cpp.
References Yosokumo::Block::cellSequence.
Referenced by removeCells().
Assignment operator - NOT IMPLEMENTED.
bool CellBlock::removeCells | ( | uint64_t | numCellsToRemove | ) |
Remove cells from the end of the block.
The specified number of cells are removed from the end of the cell sequence.
numCellsToRemove | is the number of cells to remove from the end of the block. If this value is zero no cells are removed. If this value exceeds the number of cells in the block, then all cells are removed. |
Definition at line 82 of file CellBlock.cpp.
References Yosokumo::Block::cellSequence, clearCells(), isEmpty(), and size().
uint64_t CellBlock::size | ( | ) | const |
Return the number of cells in the block.
Definition at line 109 of file CellBlock.cpp.
References Yosokumo::Block::cellSequence.
Referenced by removeCells(), and toString().
std::string CellBlock::toString | ( | ) | [virtual] |
Return a string representation of this CellBlock
.
CellBlock
. Reimplemented from Yosokumo::Block.
Definition at line 120 of file CellBlock.cpp.
References getCell(), Yosokumo::Block::getStudyIdentifier(), Yosokumo::Block::getType(), size(), and Yosokumo::Cell::toString().
Referenced by operator<<().