Scippy

GCG

Branch-and-Price & Column Generation for Everyone

JDecFileHandler Class Reference

Detailed Description

writes and reads jdec files

Definition at line 163 of file reader_jdec.cpp.

Public Member Functions

 JDecFileHandler (GCG *gcg, const char *filename)
 
 JDecFileHandler (GCG *gcg, FILE *wfile)
 
 ~JDecFileHandler ()
 
bool parseElement (AbstractJDecElementParser &elementparser, json_t *element)
 
bool readJDec (JDecData &data)
 
bool writeJDec (PARTIALDECOMP *decomp)
 

Constructor & Destructor Documentation

◆ JDecFileHandler() [1/2]

JDecFileHandler::JDecFileHandler ( GCG *  gcg,
const char *  filename 
)

constructor creating an object ready to read a jdec file

Parameters
gcgGCG data structure
filenamepath of the jdec file to be read

Definition at line 560 of file reader_jdec.cpp.

References NULL, and SCIPfopen().

◆ JDecFileHandler() [2/2]

JDecFileHandler::JDecFileHandler ( GCG *  gcg,
FILE *  wfile 
)

constructor creating an object ready to write a jdec file

Parameters
gcgGCG data structure
wfilefile pointer used to write the jdec file

Definition at line 574 of file reader_jdec.cpp.

References NULL.

◆ ~JDecFileHandler()

JDecFileHandler::~JDecFileHandler ( )

destructor

Definition at line 588 of file reader_jdec.cpp.

References SCIPfclose().

Member Function Documentation

◆ parseElement()

bool JDecFileHandler::parseElement ( AbstractJDecElementParser &  elementparser,
json_t *  element 
)

parses a json element using an element parser, returns a bool indicating success/failure

Parameters
elementparserthe element parser
elementpointer to the json element

Definition at line 608 of file reader_jdec.cpp.

References AbstractJDecElementParser::error(), AbstractJDecElementParser::handleKeyValuePair(), AbstractJDecElementParser::handleValue(), and SCIPwarningMessage().

Referenced by JDecBlockElementParser::handleKeyValuePair(), JDecDecompositionElementParser::handleKeyValuePair(), JDecDecompositionElementParser::handleValue(), AbstractJDecDecompositionElementParser::parseDecomposition(), and readJDec().

◆ readJDec()

bool JDecFileHandler::readJDec ( JDecData &  data)

reads a jdec file an stores the information in a data object, returns a bool indicating success/failure

Note
must be constructed as reader
Parameters
dataJDecData object used to store the read information

Definition at line 646 of file reader_jdec.cpp.

References checkVersion(), NULL, parseElement(), SCIPwarningMessage(), and JDecData::version.

Referenced by readJDec().

◆ writeJDec()

bool JDecFileHandler::writeJDec ( gcg::PARTIALDECOMP *  decomp)

writes a partialldec to a jdec file, returns a bool indicating success/failure, returns a bool indicating success/failure

Note
must be constructed as writer
Parameters
decomppartialdec that will be written to the jdec file

Definition at line 682 of file reader_jdec.cpp.

References checkJson(), gcg::PARTIALDECOMP::getID(), JDEC_VERSION, NULL, SCIPgetProbName(), and SCIPwarningMessage().

Referenced by writePartialdec().