Yosokumo::YosokumoDIF Class Reference

Defines methods which transform bytes obtained from HTTP requests into Yosokumo C++ objects (such as Catalog and Study) and vice versa. More...

#include <YosokumoDIF.h>

Inheritance diagram for Yosokumo::YosokumoDIF:
Inheritance graph
[legend]
Collaboration diagram for Yosokumo::YosokumoDIF:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 YosokumoDIF ()
virtual ~YosokumoDIF ()
virtual std::string getContentType ()=0
 Return a content type string for use in Accept and Content-Type HTTP header lines.
bool isException ()
 Test if an exception has occurred.
bool getException (ServiceException &e)
 Return a ServiceException from the code-decode process.
void clearException ()
 Clear the exception.
virtual bool makeCatalogFromBytes (const std::vector< uint8_t > &catalogAsBytes, Catalog &catalog)=0
 Make a Yosokumo Catalog object out of the bytes of an HTTP Entity.
virtual bool makeBytesFromCatalog (const Catalog &catalog, std::vector< uint8_t > &catalogAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Catalog object.
virtual bool makeStudyFromBytes (const std::vector< uint8_t > &studyAsBytes, Study &study)=0
 Make a Yosokumo Study object out of the bytes of an HTTP Entity.
virtual bool makeBytesFromStudy (const Study &study, std::vector< uint8_t > &studyAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Study object.
virtual bool makeStudyNameFromBytes (const std::vector< uint8_t > &studyNameAsBytes, std::string &name)=0
 Make a Yosokumo Study name out of the bytes of an HTTP Entity.
virtual bool makeBytesFromStudyName (const std::string &name, std::vector< uint8_t > &studyNameAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Study name.
virtual bool makeStudyStatusFromBytes (const std::vector< uint8_t > &studyStatusAsBytes, Study::Status &status)=0
 Make a Yosokumo Study status out of the bytes of an HTTP Entity.
virtual bool makeBytesFromStudyStatus (const Study::Status status, std::vector< uint8_t > &studyStatusAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Study status.
virtual bool makeStudyVisibilityFromBytes (const std::vector< uint8_t > &studyVisibilityAsBytes, Study::Visibility &visibility)=0
 Make a Yosokumo Study visibility out of the bytes of an HTTP Entity.
virtual bool makeBytesFromStudyVisibility (const Study::Visibility visibility, std::vector< uint8_t > &studyVisibilityAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Study visibility.
virtual bool makePanelFromBytes (const std::vector< uint8_t > &panelAsBytes, Panel &panel)=0
 Make a Yosokumo Panel object out of the bytes of an HTTP Entity.
virtual bool makeBytesFromPanel (const Panel &panel, std::vector< uint8_t > &panelAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Panel object.
virtual bool makeRoleFromBytes (const std::vector< uint8_t > &roleAsBytes, Role &role)=0
 Make a Yosokumo Role object out of the bytes of an HTTP Entity.
virtual bool makeBytesFromRole (const Role &role, std::vector< uint8_t > &roleAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Role object.
virtual bool makeRosterFromBytes (const std::vector< uint8_t > &rosterAsBytes, Roster &roster)=0
 Make a Yosokumo Roster object out of the bytes of an HTTP Entity.
virtual bool makeBytesFromRoster (const Roster &roster, std::vector< uint8_t > &rosterAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Roster object.
virtual bool makePredictorFromBytes (const std::vector< uint8_t > &predictorAsBytes, Predictor &predictor)=0
 Make a Yosokumo Predictor object out of the bytes of an HTTP Entity.
virtual bool makeBytesFromPredictor (const Predictor &predictor, std::vector< uint8_t > &predictorAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Predictor object.
virtual bool makeCellFromBytes (const std::vector< uint8_t > &cellAsBytes, Cell &cell)=0
 Make a Yosokumo Cell object out of the bytes of an HTTP Entity.
virtual bool makeBytesFromCell (const Cell &cell, std::vector< uint8_t > &cellAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Cell object.
virtual bool makeSpecimenFromBytes (const std::vector< uint8_t > &specimenAsBytes, Specimen &specimen)=0
 Make a Yosokumo Specimen object out of the bytes of an HTTP Entity.
virtual bool makeBytesFromSpecimen (const Specimen &specimen, std::vector< uint8_t > &specimenAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Specimen object.
virtual bool makeBlockFromBytes (const std::vector< uint8_t > &blockAsBytes, Block &block)=0
 Make a Yosokumo Block object out of the bytes of an HTTP Entity.
virtual bool makeBytesFromBlock (const Block &block, std::vector< uint8_t > &blockAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Block object.
virtual bool makeMessageFromBytes (const std::vector< uint8_t > &messageAsBytes, Message &message)=0
 Make a Yosokumo Message object out of the bytes of an HTTP Entity.
virtual bool makeBytesFromMessage (const Message &message, std::vector< uint8_t > &messageAsBytes)=0
 Make the bytes for an HTTP Entity out of a Yosokumo Message object.

Static Public Member Functions

static bool isException (const ServiceException &e)
 Test if really an exception.

Protected Attributes

ServiceException exception

Detailed Description

Defines methods which transform bytes obtained from HTTP requests into Yosokumo C++ objects (such as Catalog and Study) and vice versa.

Each class implementing this interface handles a different DIF, e.g., XML and Google Protocol Buffers.

Definition at line 29 of file YosokumoDIF.h.


Constructor & Destructor Documentation

YosokumoDIF::YosokumoDIF (  ) 

Definition at line 10 of file YosokumoDIF.cpp.

References clearException().

YosokumoDIF::~YosokumoDIF (  )  [virtual]

Definition at line 15 of file YosokumoDIF.cpp.


Member Function Documentation

void YosokumoDIF::clearException (  ) 

Clear the exception.

Definition at line 45 of file YosokumoDIF.cpp.

References exception.

Referenced by YosokumoDIF().

virtual std::string Yosokumo::YosokumoDIF::getContentType (  )  [pure virtual]

Return a content type string for use in Accept and Content-Type HTTP header lines.

For example, "application/yosokumo+protobuf".

Returns:
a content type string for use in Accept and other HTTP headers.

Implemented in Yosokumo::YosokumoProtobuf.

bool YosokumoDIF::getException ( ServiceException e  ) 

Return a ServiceException from the code-decode process.

Parameters:
e if there is an exception, it is placed here.
Returns:
true means there is an exception, and it has been placed in e. false means there is no exception, e is unchanged.

Definition at line 34 of file YosokumoDIF.cpp.

References exception, and isException().

bool YosokumoDIF::isException ( const ServiceException e  )  [static]

Test if really an exception.

Parameters:
e the exception to be tested.
Returns:
true means e is an exception. false means e is not an exception.

Definition at line 23 of file YosokumoDIF.cpp.

References Yosokumo::ServiceException::getFailedMethodName(), Yosokumo::ServiceException::getStatusCode(), and Yosokumo::ServiceException::what().

bool YosokumoDIF::isException (  ) 

Test if an exception has occurred.

Returns:
true means there is an exception. false means there is no exception.

Definition at line 18 of file YosokumoDIF.cpp.

References exception.

Referenced by getException().

virtual bool Yosokumo::YosokumoDIF::makeBlockFromBytes ( const std::vector< uint8_t > &  blockAsBytes,
Block block 
) [pure virtual]

Make a Yosokumo Block object out of the bytes of an HTTP Entity.

Parameters:
blockAsBytes a block as bytes from an HTTP Entity.
block the output block created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output block may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromBlock ( const Block block,
std::vector< uint8_t > &  blockAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Block object.

Parameters:
block a Yosokumo Block object.
blockAsBytes the output bytes created from the block.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromCatalog ( const Catalog catalog,
std::vector< uint8_t > &  catalogAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Catalog object.

Parameters:
catalog a Yosokumo Catalog object.
catalogAsBytes the output bytes created from the catalog.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromCell ( const Cell cell,
std::vector< uint8_t > &  cellAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Cell object.

Parameters:
cell a Yosokumo Cell object.
cellAsBytes the output bytes created from the cell.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromMessage ( const Message message,
std::vector< uint8_t > &  messageAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Message object.

Parameters:
message a Yosokumo Message object.
messageAsBytes the output bytes created from the message.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromPanel ( const Panel panel,
std::vector< uint8_t > &  panelAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Panel object.

Parameters:
panel a Yosokumo Panel object.
panelAsBytes the output bytes created from the panel.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromPredictor ( const Predictor predictor,
std::vector< uint8_t > &  predictorAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Predictor object.

Parameters:
predictor a Yosokumo Predictor object.
predictorAsBytes the output bytes created from the predictor.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromRole ( const Role role,
std::vector< uint8_t > &  roleAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Role object.

Parameters:
role a Yosokumo Role object.
roleAsBytes the output bytes created from the role.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromRoster ( const Roster roster,
std::vector< uint8_t > &  rosterAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Roster object.

Parameters:
roster a Yosokumo Roster object.
rosterAsBytes the output bytes created from the roster.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromSpecimen ( const Specimen specimen,
std::vector< uint8_t > &  specimenAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Specimen object.

Parameters:
specimen a Yosokumo Specimen object.
specimenAsBytes the output bytes created from the specimen.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromStudy ( const Study study,
std::vector< uint8_t > &  studyAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Study object.

Parameters:
study a Yosokumo Study object.
studyAsBytes the output bytes created from the study.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromStudyName ( const std::string &  name,
std::vector< uint8_t > &  studyNameAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Study name.

Parameters:
name a Yosokumo Study name.
studyNameAsBytes the output bytes created from the study name.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromStudyStatus ( const Study::Status  status,
std::vector< uint8_t > &  studyStatusAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Study status.

Parameters:
status a Yosokumo Study status.
studyStatusAsBytes the output bytes created from the study status.
Returns:
true means everything worked out fine. false means there was a problem; the output bytes may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeBytesFromStudyVisibility ( const Study::Visibility  visibility,
std::vector< uint8_t > &  studyVisibilityAsBytes 
) [pure virtual]

Make the bytes for an HTTP Entity out of a Yosokumo Study visibility.

Parameters:
visibility a Yosokumo Study visibility.
studyVisibilityAsBytes the output bytes created from the study visibility.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeCatalogFromBytes ( const std::vector< uint8_t > &  catalogAsBytes,
Catalog catalog 
) [pure virtual]

Make a Yosokumo Catalog object out of the bytes of an HTTP Entity.

Parameters:
catalogAsBytes a catalog as bytes from an HTTP Entity.
catalog the output catalog created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output catalog may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeCellFromBytes ( const std::vector< uint8_t > &  cellAsBytes,
Cell cell 
) [pure virtual]

Make a Yosokumo Cell object out of the bytes of an HTTP Entity.

Parameters:
cellAsBytes a cell as bytes from an HTTP Entity.
cell the output cell created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output cell may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeMessageFromBytes ( const std::vector< uint8_t > &  messageAsBytes,
Message message 
) [pure virtual]

Make a Yosokumo Message object out of the bytes of an HTTP Entity.

Parameters:
messageAsBytes a message as bytes from an HTTP Entity.
message the output message created from the bytes.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makePanelFromBytes ( const std::vector< uint8_t > &  panelAsBytes,
Panel panel 
) [pure virtual]

Make a Yosokumo Panel object out of the bytes of an HTTP Entity.

Parameters:
panelAsBytes a panel as bytes from an HTTP Entity.
panel the output panel created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output panel may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makePredictorFromBytes ( const std::vector< uint8_t > &  predictorAsBytes,
Predictor predictor 
) [pure virtual]

Make a Yosokumo Predictor object out of the bytes of an HTTP Entity.

Parameters:
predictorAsBytes a predictor as bytes from an HTTP Entity.
predictor the output predictor created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output predictor may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeRoleFromBytes ( const std::vector< uint8_t > &  roleAsBytes,
Role role 
) [pure virtual]

Make a Yosokumo Role object out of the bytes of an HTTP Entity.

Parameters:
roleAsBytes a role as bytes from an HTTP Entity.
role the output role created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output role may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeRosterFromBytes ( const std::vector< uint8_t > &  rosterAsBytes,
Roster roster 
) [pure virtual]

Make a Yosokumo Roster object out of the bytes of an HTTP Entity.

Parameters:
rosterAsBytes a roster as bytes from an HTTP Entity.
roster the output roster created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output roster may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeSpecimenFromBytes ( const std::vector< uint8_t > &  specimenAsBytes,
Specimen specimen 
) [pure virtual]

Make a Yosokumo Specimen object out of the bytes of an HTTP Entity.

Parameters:
specimenAsBytes a specimen as bytes from an HTTP Entity.
specimen the output specimen created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output specimen may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeStudyFromBytes ( const std::vector< uint8_t > &  studyAsBytes,
Study study 
) [pure virtual]

Make a Yosokumo Study object out of the bytes of an HTTP Entity.

Parameters:
studyAsBytes a study as bytes from an HTTP Entity.
study the output study created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output study may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeStudyNameFromBytes ( const std::vector< uint8_t > &  studyNameAsBytes,
std::string &  name 
) [pure virtual]

Make a Yosokumo Study name out of the bytes of an HTTP Entity.

Parameters:
studyNameAsBytes a study name as bytes from an HTTP Entity.
name the output study name created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output study name may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeStudyStatusFromBytes ( const std::vector< uint8_t > &  studyStatusAsBytes,
Study::Status status 
) [pure virtual]

Make a Yosokumo Study status out of the bytes of an HTTP Entity.

Parameters:
studyStatusAsBytes a study status as bytes from an HTTP Entity.
status the output study status created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output study status may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.

virtual bool Yosokumo::YosokumoDIF::makeStudyVisibilityFromBytes ( const std::vector< uint8_t > &  studyVisibilityAsBytes,
Study::Visibility visibility 
) [pure virtual]

Make a Yosokumo Study visibility out of the bytes of an HTTP Entity.

Parameters:
studyVisibilityAsBytes a study visibility as bytes from an HTTP Entity.
visibility the output study visibility created from the bytes.
Returns:
true means everything worked out fine. false means there was a problem; the output study visibility may be incomplete. Call getException() for details.

Implemented in Yosokumo::YosokumoProtobuf.


Member Data Documentation

Definition at line 32 of file YosokumoDIF.h.

Referenced by clearException(), getException(), isException(), Yosokumo::YosokumoProtobuf::levelToProtobufLevel(), Yosokumo::YosokumoProtobuf::makeCatalogFromProtobufCatalog(), Yosokumo::YosokumoProtobuf::makeCellFromProtobufCell(), Yosokumo::YosokumoProtobuf::makeProtobufBlockFromBlock(), Yosokumo::YosokumoProtobuf::makeProtobufBlockFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufCatalogFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufCellFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufCellFromCell(), Yosokumo::YosokumoProtobuf::makeProtobufMessageFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufPanelFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufPredictorFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufRoleFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufRosterFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufSpecimenFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufSpecimenFromSpecimen(), Yosokumo::YosokumoProtobuf::makeProtobufStudyFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufStudyNameControlFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufStudyStatusControlFromBytes(), Yosokumo::YosokumoProtobuf::makeProtobufStudyVisibilityControlFromBytes(), Yosokumo::YosokumoProtobuf::makeRosterFromProtobufRoster(), Yosokumo::YosokumoProtobuf::makeSpecimenFromProtobufSpecimen(), Yosokumo::YosokumoProtobuf::protoLevelToLevel(), Yosokumo::YosokumoProtobuf::protoStatusToStatus(), Yosokumo::YosokumoProtobuf::protoTypeToType(), Yosokumo::YosokumoProtobuf::protoVisibilityToVisibility(), Yosokumo::YosokumoProtobuf::statusToProtobufStatus(), Yosokumo::YosokumoProtobuf::typeToProtobufType(), and Yosokumo::YosokumoProtobuf::visibilityToProtobufVisibility().


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