Yosokumo::Block Class Reference

A base class for EmptyBlock, CellBlock, PredictorBlock, and SpecimenBlock. More...

#include <Block.h>

Inheritance diagram for Yosokumo::Block:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Type { EMPTY, PREDICTOR, SPECIMEN, CELL }
 

Indicates what is stored in the Block, e.g., Cells, Predictors, or Specimens.

More...

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< CellcellSequence
 A sequence of Cell.
std::vector< PredictorpredictorSequence
 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.

Detailed Description

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.


Member Enumeration Documentation

Indicates what is stored in the Block, e.g., Cells, Predictors, or Specimens.

Enumerator:
EMPTY 

an empty block.

PREDICTOR 

a Predictor block.

SPECIMEN 

a Specimen block.

CELL 

a Cell block.

Definition at line 33 of file Block.h.


Constructor & Destructor Documentation

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.

Parameters:
id a study identifier for the block.

Definition at line 14 of file Block.cpp.

References cellSequence, predictorSequence, and specimenSequence.

Block::~Block (  )  [virtual]

Destructor.

Definition at line 21 of file Block.cpp.


Member Function Documentation

std::string Block::getStudyIdentifier (  )  const

Return the study identifier of the block.

Returns:
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.

Returns:
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.

Parameters:
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.

Parameters:
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.

Returns:
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().


Member Data Documentation

std::vector<Cell> Yosokumo::Block::cellSequence [protected]
std::vector<Specimen*> Yosokumo::Block::specimenSequence [protected]
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().

The type of the block.

Definition at line 59 of file Block.h.

Referenced by getType(), and setType().


The documentation for this class was generated from the following files:
Generated on Mon May 13 09:19:11 2013 for C++ Yosokumo API by  doxygen 1.6.3