1    	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2    	/*                                                                           */
3    	/*                  This file is part of the program and library             */
4    	/*         SCIP --- Solving Constraint Integer Programs                      */
5    	/*                                                                           */
6    	/*  Copyright (c) 2002-2023 Zuse Institute Berlin (ZIB)                      */
7    	/*                                                                           */
8    	/*  Licensed under the Apache License, Version 2.0 (the "License");          */
9    	/*  you may not use this file except in compliance with the License.         */
10   	/*  You may obtain a copy of the License at                                  */
11   	/*                                                                           */
12   	/*      http://www.apache.org/licenses/LICENSE-2.0                           */
13   	/*                                                                           */
14   	/*  Unless required by applicable law or agreed to in writing, software      */
15   	/*  distributed under the License is distributed on an "AS IS" BASIS,        */
16   	/*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17   	/*  See the License for the specific language governing permissions and      */
18   	/*  limitations under the License.                                           */
19   	/*                                                                           */
20   	/*  You should have received a copy of the Apache-2.0 license                */
21   	/*  along with SCIP; see the file LICENSE. If not visit scipopt.org.         */
22   	/*                                                                           */
23   	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24   	
25   	/**@file   reader.h
26   	 * @ingroup INTERNALAPI
27   	 * @brief  internal methods for input file readers
28   	 * @author Tobias Achterberg
29   	 */
30   	
31   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32   	
33   	#ifndef __SCIP_READER_H__
34   	#define __SCIP_READER_H__
35   	
36   	
37   	#include "scip/def.h"
38   	#include "scip/type_prob.h"
39   	#include "scip/type_retcode.h"
40   	#include "scip/type_result.h"
41   	#include "scip/type_set.h"
42   	#include "scip/type_reader.h"
43   	#include "scip/pub_reader.h"
44   	
45   	#ifdef __cplusplus
46   	extern "C" {
47   	#endif
48   	
49   	
50   	/** copies the given reader to a new scip */
51   	SCIP_RETCODE SCIPreaderCopyInclude(
52   	   SCIP_READER*          reader,             /**< reader */
53   	   SCIP_SET*             set                 /**< SCIP_SET of SCIP to copy to */
54   	   );
55   	
56   	/** creates a reader */
57   	SCIP_RETCODE SCIPreaderCreate(
58   	   SCIP_READER**         reader,             /**< pointer to store reader */
59   	   SCIP_SET*             set,                /**< global SCIP settings */
60   	   const char*           name,               /**< name of reader */
61   	   const char*           desc,               /**< description of reader */
62   	   const char*           extension,          /**< file extension that reader processes */
63   	   SCIP_DECL_READERCOPY  ((*readercopy)),    /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
64   	   SCIP_DECL_READERFREE  ((*readerfree)),    /**< destructor of reader */
65   	   SCIP_DECL_READERREAD  ((*readerread)),    /**< read method */
66   	   SCIP_DECL_READERWRITE ((*readerwrite)),   /**< write method */
67   	   SCIP_READERDATA*      readerdata          /**< reader data */
68   	   );
69   	
70   	/** frees memory of reader */
71   	SCIP_RETCODE SCIPreaderFree(
72   	   SCIP_READER**         reader,             /**< pointer to reader data structure */
73   	   SCIP_SET*             set                 /**< global SCIP settings */
74   	   );
75   	
76   	/** reads problem data from file with given reader or returns SCIP_DIDNOTRUN */
77   	SCIP_RETCODE SCIPreaderRead(
78   	   SCIP_READER*          reader,             /**< reader */
79   	   SCIP_SET*             set,                /**< global SCIP settings */
80   	   const char*           filename,           /**< name of the input file */
81   	   const char*           extension,          /**< extension of the input file name */
82   	   SCIP_RESULT*          result              /**< pointer to store the result of the callback method */
83   	   );
84   	
85   	/** writes problem data to file with given reader or returns SCIP_DIDNOTRUN */
86   	SCIP_RETCODE SCIPreaderWrite(
87   	   SCIP_READER*          reader,             /**< reader */
88   	   SCIP_PROB*            prob,               /**< problem data */
89   	   SCIP_SET*             set,                /**< global SCIP settings */
90   	   FILE*                 file,               /**< output file (or NULL for standard output) */
91   	   const char*           format,             /**< file format (or NULL) */
92   	   SCIP_Bool             genericnames,       /**< using generic variable and constraint names? */
93   	   SCIP_RESULT*          result              /**< pointer to store the result of the callback method */
94   	   );
95   	
96   	/** gets time in seconds used in this reader for reading */
97   	SCIP_Real SCIPreaderGetReadingTime(
98   	   SCIP_READER*          reader              /**< reader */
99   	   );
100  	
101  	/** enables or disables all clocks of \p reader, depending on the value of the flag */
102  	void SCIPreaderEnableOrDisableClocks(
103  	   SCIP_READER*          reader,             /**< the reader for which all clocks should be enabled or disabled */
104  	   SCIP_Bool             enable              /**< should the clocks be enabled? */
105  	   );
106  	
107  	/** resets reading time of reader */
108  	SCIP_RETCODE SCIPreaderResetReadingTime(
109  	   SCIP_READER*          reader              /**< reader */
110  	   );
111  	
112  	/** sets copy method of reader */
113  	void SCIPreaderSetCopy(
114  	   SCIP_READER*          reader,             /**< reader */
115  	   SCIP_DECL_READERCOPY  ((*readercopy))     /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
116  	   );
117  	
118  	/** sets destructor of reader */
119  	void SCIPreaderSetFree(
120  	   SCIP_READER*          reader,             /**< reader */
121  	   SCIP_DECL_READERFREE  ((*readerfree))     /**< destructor of reader */
122  	   );
123  	
124  	/** sets read method of reader */
125  	void SCIPreaderSetRead(
126  	   SCIP_READER*          reader,             /**< reader */
127  	   SCIP_DECL_READERREAD  ((*readerread))     /**< read method */
128  	   );
129  	
130  	/** sets write method of reader */
131  	void SCIPreaderSetWrite(
132  	   SCIP_READER*          reader,             /**< reader */
133  	   SCIP_DECL_READERWRITE ((*readerwrite))    /**< write method */
134  	   );
135  	
136  	#ifdef __cplusplus
137  	}
138  	#endif
139  	
140  	#endif
141