Scippy

SCIP

Solving Constraint Integer Programs

objreader.h File Reference

Detailed Description

C++ wrapper for file readers and writers.

Author
Tobias Achterberg

Definition in file objreader.h.

#include <cstring>
#include "scip/scip.h"
#include "objscip/objcloneable.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPincludeObjReader (SCIP *scip, scip::ObjReader *objreader, SCIP_Bool deleteobject)
 
scip::ObjReaderSCIPfindObjReader (SCIP *scip, const char *name)
 
scip::ObjReaderSCIPgetObjReader (SCIP *scip, SCIP_READER *reader)
 

Function Documentation

SCIP_RETCODE SCIPincludeObjReader ( SCIP scip,
scip::ObjReader objreader,
SCIP_Bool  deleteobject 
)

creates the file reader for the given file reader object and includes it in SCIP

The method should be called in one of the following ways:

  1. The user is resposible of deleting the object: SCIP_CALL( SCIPcreate(&scip) ); ... MyReader* myreader = new MyReader(...); SCIP_CALL( SCIPincludeObjReader(scip, &myreader, FALSE) ); ... SCIP_CALL( SCIPfree(&scip) ); delete myreader; // delete reader AFTER SCIPfree() !
  2. The object pointer is passed to SCIP and deleted by SCIP in the SCIPfree() call: SCIP_CALL( SCIPcreate(&scip) ); ... SCIP_CALL( SCIPincludeObjReader(scip, new MyReader(...), TRUE) ); ... SCIP_CALL( SCIPfree(&scip) ); // destructor of MyReader is called here

creates the file reader for the given file reader object and includes it in SCIP

Parameters
scipSCIP data structure
objreaderfile reader object
deleteobjectshould the reader object be deleted when reader is freed?

Definition at line 146 of file objreader.cpp.

References NULL, SCIP_CALL, scip::ObjReader::scip_desc_, scip::ObjReader::scip_extension_, scip::ObjReader::scip_name_, SCIP_OKAY, and SCIPincludeReader().

Referenced by SCIP_DECL_READERCOPY(), and scip::ObjReader::SCIP_DECL_READERWRITE().

scip::ObjReader* SCIPfindObjReader ( SCIP scip,
const char *  name 
)

returns the reader object of the given name, or 0 if not existing

Parameters
scipSCIP data structure
namename of file reader

Definition at line 171 of file objreader.cpp.

References NULL, SCIPfindReader(), and SCIPreaderGetData().

Referenced by scip::ObjReader::SCIP_DECL_READERWRITE().

scip::ObjReader* SCIPgetObjReader ( SCIP scip,
SCIP_READER reader 
)

returns the reader object for the given file reader

Parameters
scipSCIP data structure
readerfile reader

Definition at line 190 of file objreader.cpp.

References NULL, and SCIPreaderGetData().

Referenced by scip::ObjReader::SCIP_DECL_READERWRITE().