~jdpipe/ascend/trunk-old

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef ASCXX_SOLVER_H
#define ASCXX_SOLVER_H

#include <string>
#include <vector>

#include "config.h"
extern "C"{
#include <ascend/general/platform.h>
#include <ascend/compiler/instance_enum.h>
#include <ascend/system/slv_client.h>
}

/**
	This is a rather problematic wrapper for slv_client.h. It's hard because registerd solvers
	are referenced primarily by index, not by pointer etc, so given the index, we always have
	to look up the solver in some way or other.

	Because the index is changeable from session to session, depending on the order of
	registration, we'll use the *name* as the primary key and look up the index as needed.
*/
class Solver{
private:
	std::string name;
public:
	Solver();
	Solver(const Solver &);
	Solver(const std::string &name);

	const int getIndex() const;
	const std::string& getName() const;
};

/**
	Some global functions
*/
void registerStandardSolvers();
//void registerSolver(SlvRegistration regfuncptr);
const std::vector<Solver> getSolvers();

#endif