Loading...
Searching...
No Matches
gamsjob.h
1/*
2 * GAMS - General Algebraic Modeling System C++ API
3 *
4 * Copyright (c) 2017-2023 GAMS Software GmbH <support@gams.com>
5 * Copyright (c) 2017-2023 GAMS Development Corp. <support@gams.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 */
25
26#ifndef GAMSJOB_H
27#define GAMSJOB_H
28
29#include "gamslib_global.h"
30#include <string>
31#include <memory>
32#include <vector>
33#include "gamsenum.h"
34
35namespace gams {
36
37class GAMSWorkspace;
38class GAMSModelInstance;
39class GAMSJobImpl;
40class GAMSOptions;
41class GAMSCheckpoint;
42class GAMSDatabase;
43
58class LIBSPEC GAMSJob
59{
60public:
63
66
70 GAMSJob operator=(const GAMSJob& other);
71
75 bool operator!=(const GAMSJob& other) const;
76
80 bool operator==(const GAMSJob& other) const;
81
84 bool isValid() const;
85
86 //TODO: complete run methods
87
89 void run();
90
93 void run(std::ostream& outstream);
94
97 void run(GAMSOptions& gamsOptions);
98
102 void run(GAMSOptions& gamsOptions, std::ostream& outstream);
103
107 void run(GAMSOptions& gamsOptions, GAMSDatabase db);
108
111 void run(GAMSCheckpoint gamsCheckpoint);
112
116 void run(GAMSOptions& gamsOptions, GAMSCheckpoint gamsCheckpoint);
117
124 void run(GAMSOptions& gamsOptions, GAMSCheckpoint gamsCheckpoint, std::ostream& output, bool createOutDB
125 , std::vector<gams::GAMSDatabase> databases);
126
129
131 std::string name();
132
135
139 bool interrupt();
140
143 LogId logID();
144
145private:
146 friend class GAMSWorkspaceImpl;
147 GAMSJob(const std::shared_ptr<::gams::GAMSJobImpl>& impl);
148 GAMSJob(gams::GAMSWorkspace &ws, const std::string& jobName = "", const std::string& fileName = ""
149 , const GAMSCheckpoint *checkpoint = 0);
150
151private:
152 std::shared_ptr<::gams::GAMSJobImpl> mImpl;
153};
154
155} // namespace gams
156
157#endif // GAMSJOB_H
~GAMSJob()
Desctructor.
GAMSWorkspace workspace()
Get GAMSWorkspace containing GAMSJob.
bool operator!=(const GAMSJob &other) const
void run(GAMSOptions &gamsOptions, GAMSCheckpoint gamsCheckpoint)
void run(GAMSCheckpoint gamsCheckpoint)
void run(GAMSOptions &gamsOptions, GAMSCheckpoint gamsCheckpoint, std::ostream &output, bool createOutDB, std::vector< gams::GAMSDatabase > databases)
bool interrupt()
void run(GAMSOptions &gamsOptions, GAMSDatabase db)
bool operator==(const GAMSJob &other) const
void run(std::ostream &outstream)
GAMSDatabase outDB()
Get GAMSDatabase created by Run method.
GAMSJob operator=(const GAMSJob &other)
GAMSJob()
Standard constructor.
void run(GAMSOptions &gamsOptions)
std::string name()
Retrieve name of GAMSJob.
void run()
Run GAMSJob.
void run(GAMSOptions &gamsOptions, std::ostream &outstream)
bool isValid() const
Definition: gams.h:91