Frobby  0.9.0
IOParameters.h
Go to the documentation of this file.
1 /* Frobby: Software for monomial ideal computations.
2  Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see http://www.gnu.org/licenses/.
16 */
17 #ifndef IO_PARAMETERS_GUARD
18 #define IO_PARAMETERS_GUARD
19 
20 #include "ParameterGroup.h"
21 #include "StringParameter.h"
22 #include "IOHandler.h"
23 
24 class Scanner;
25 class DataType;
26 
27 class IOParameters : public ParameterGroup {
28  public:
29  IOParameters(const DataType& input, const DataType& output);
30 
31  void setOutputFormat(const string& format);
32  void setInputFormat(const string& format);
33 
34  const string& getInputFormat() const;
35  const string& getOutputFormat() const;
36 
37  auto_ptr<IOHandler> createInputHandler() const;
38  auto_ptr<IOHandler> createOutputHandler() const;
39 
46 
47  // Exits with an error message if the input or output format is not
48  // known.
49  void validateFormats() const;
50 
51  private:
54 
55  auto_ptr<StringParameter> _inputFormat;
56  auto_ptr<StringParameter> _outputFormat;
57 };
58 
59 #endif
IOParameters::setOutputFormat
void setOutputFormat(const string &format)
Definition: IOParameters.cpp:95
IOHandler.h
Scanner
This class offers an input interface which is more convenient and for some purposes more efficient th...
Definition: Scanner.h:50
IOParameters
Definition: IOParameters.h:27
IOParameters::validateFormats
void validateFormats() const
Definition: IOParameters.cpp:154
IOParameters::_outputFormat
auto_ptr< StringParameter > _outputFormat
Definition: IOParameters.h:56
ParameterGroup
Definition: ParameterGroup.h:23
IOParameters::createInputHandler
auto_ptr< IOHandler > createInputHandler() const
Definition: IOParameters.cpp:129
IOParameters::autoDetectInputFormat
void autoDetectInputFormat(Scanner &in)
If using the input format, this must be called before validating the ideals, since the auto detect fo...
Definition: IOParameters.cpp:141
IOParameters::setInputFormat
void setInputFormat(const string &format)
Definition: IOParameters.cpp:102
IOParameters::_inputType
const DataType & _inputType
Definition: IOParameters.h:52
StringParameter.h
IOParameters::IOParameters
IOParameters(const DataType &input, const DataType &output)
Definition: IOParameters.cpp:27
IOParameters::getOutputFormat
const string & getOutputFormat() const
Definition: IOParameters.cpp:115
IOParameters::getInputFormat
const string & getInputFormat() const
Definition: IOParameters.cpp:108
ParameterGroup.h
DataType
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
Definition: DataType.h:29
IOParameters::createOutputHandler
auto_ptr< IOHandler > createOutputHandler() const
Definition: IOParameters.cpp:135
IOParameters::_outputType
const DataType & _outputType
Definition: IOParameters.h:53
IOParameters::_inputFormat
auto_ptr< StringParameter > _inputFormat
Definition: IOParameters.h:55