A base class for EmptyBlock
, CellBlock
, PredictorBlock
, and SpecimenBlock
.
More...
#include <Block.h>
Public Types | |
enum | Type { EMPTY, PREDICTOR, SPECIMEN, CELL } |
Indicates what is stored in the | |
Public Member Functions | |
Block () | |
Initializes a newly created Block object with default attributes. | |
Block (std::string id) | |
Initializes a newly created Block object with a study identifier. | |
virtual | ~Block () |
Destructor. | |
void | setType (Type t) |
Set the type of the block. | |
Type | getType () const |
Return the type of the block. | |
void | setStudyIdentifier (std::string id) |
Set the study identifier of the block. | |
std::string | getStudyIdentifier () const |
Return the study identifier of the block. | |
virtual std::string | toString () |
Return the block as a string. | |
Protected Attributes | |
std::vector< Cell > | cellSequence |
A sequence of Cell . | |
std::vector< Predictor > | predictorSequence |
A sequence of Predictor . | |
std::vector< Specimen * > | specimenSequence |
A sequence of Specimen* . | |
Private Attributes | |
Type | type |
The type of the block. | |
std::string | studyIdentifier |
Specifies the study which the block is associated with. |
A base class for EmptyBlock
, CellBlock
, PredictorBlock
, and SpecimenBlock
.
The Block
class is not visible in the API. It is a way to package up Cells
, Predictors
and Specimens
for transmission to the Yosokumo web service via HTTP, so that HTTP requests are never too large.
Definition at line 25 of file Block.h.
Block::Block | ( | ) |
Initializes a newly created Block
object with default attributes.
Definition at line 7 of file Block.cpp.
References cellSequence, predictorSequence, and specimenSequence.
Block::Block | ( | std::string | id | ) |
Initializes a newly created Block
object with a study identifier.
id | a study identifier for the block. |
Definition at line 14 of file Block.cpp.
References cellSequence, predictorSequence, and specimenSequence.
std::string Block::getStudyIdentifier | ( | ) | const |
Return the study identifier of the block.
Definition at line 39 of file Block.cpp.
References studyIdentifier.
Referenced by Yosokumo::YosokumoProtobuf::makeProtobufBlockFromBlock(), Yosokumo::SpecimenBlock::toString(), Yosokumo::PredictorBlock::toString(), Yosokumo::CellBlock::toString(), and toString().
Block::Type Block::getType | ( | ) | const |
Return the type of the block.
Reimplemented in Yosokumo::EmptyBlock.
Definition at line 29 of file Block.cpp.
References type.
Referenced by Yosokumo::YosokumoProtobuf::makeProtobufBlockFromBlock(), Yosokumo::SpecimenBlock::toString(), Yosokumo::PredictorBlock::toString(), Yosokumo::CellBlock::toString(), and toString().
void Block::setStudyIdentifier | ( | std::string | id | ) |
Set the study identifier of the block.
id | the identifier to assign to the block. |
Definition at line 34 of file Block.cpp.
References studyIdentifier.
void Block::setType | ( | Type | t | ) |
Set the type of the block.
t | the type to assign to the block. |
Definition at line 24 of file Block.cpp.
References type.
Referenced by Yosokumo::CellBlock::CellBlock(), Yosokumo::PredictorBlock::PredictorBlock(), and Yosokumo::SpecimenBlock::SpecimenBlock().
std::string Block::toString | ( | ) | [virtual] |
Return the block as a string.
Reimplemented in Yosokumo::CellBlock, Yosokumo::EmptyBlock, Yosokumo::PredictorBlock, and Yosokumo::SpecimenBlock.
Definition at line 44 of file Block.cpp.
References getStudyIdentifier(), and getType().
std::vector<Cell> Yosokumo::Block::cellSequence [protected] |
A sequence of Cell
.
Definition at line 82 of file Block.h.
Referenced by Yosokumo::CellBlock::addCell(), Yosokumo::CellBlock::addCells(), Block(), Yosokumo::CellBlock::clearCells(), Yosokumo::CellBlock::getCell(), Yosokumo::CellBlock::isEmpty(), Yosokumo::CellBlock::removeCells(), and Yosokumo::CellBlock::size().
std::vector<Predictor> Yosokumo::Block::predictorSequence [protected] |
A sequence of Predictor
.
Definition at line 87 of file Block.h.
Referenced by Yosokumo::PredictorBlock::addPredictor(), Yosokumo::PredictorBlock::addPredictors(), Block(), Yosokumo::PredictorBlock::clearPredictors(), Yosokumo::PredictorBlock::getPredictor(), Yosokumo::PredictorBlock::isEmpty(), Yosokumo::PredictorBlock::removePredictors(), and Yosokumo::PredictorBlock::size().
std::vector<Specimen*> Yosokumo::Block::specimenSequence [protected] |
A sequence of Specimen*
.
Definition at line 92 of file Block.h.
Referenced by Yosokumo::SpecimenBlock::addSpecimen(), Block(), Yosokumo::SpecimenBlock::clearSpecimens(), Yosokumo::SpecimenBlock::getSpecimen(), Yosokumo::SpecimenBlock::isEmpty(), Yosokumo::SpecimenBlock::removeSpecimens(), and Yosokumo::SpecimenBlock::size().
std::string Yosokumo::Block::studyIdentifier [private] |
Specifies the study which the block is associated with.
Definition at line 65 of file Block.h.
Referenced by getStudyIdentifier(), and setStudyIdentifier().
Type Yosokumo::Block::type [private] |