1 |
#ifndef ASCXX_SOLVER_H |
2 |
#define ASCXX_SOLVER_H |
3 |
|
4 |
#include <string> |
5 |
#include <vector> |
6 |
|
7 |
#include "config.h" |
8 |
extern "C"{ |
9 |
#include <ascend/general/platform.h> |
10 |
#include <ascend/compiler/instance_enum.h> |
11 |
#include <ascend/system/slv_client.h> |
12 |
} |
13 |
|
14 |
/** |
15 |
This is a rather problematic wrapper for slv_client.h. It's hard because registerd solvers |
16 |
are referenced primarily by index, not by pointer etc, so given the index, we always have |
17 |
to look up the solver in some way or other. |
18 |
|
19 |
Because the index is changeable from session to session, depending on the order of |
20 |
registration, we'll use the *name* as the primary key and look up the index as needed. |
21 |
*/ |
22 |
class Solver{ |
23 |
private: |
24 |
std::string name; |
25 |
public: |
26 |
Solver(); |
27 |
Solver(const Solver &); |
28 |
Solver(const std::string &name); |
29 |
|
30 |
const int getIndex() const; |
31 |
const std::string& getName() const; |
32 |
}; |
33 |
|
34 |
/** |
35 |
Some global functions |
36 |
*/ |
37 |
void registerStandardSolvers(); |
38 |
//void registerSolver(SlvRegistration regfuncptr); |
39 |
const std::vector<Solver> getSolvers(); |
40 |
|
41 |
#endif |