/[ascend]/trunk/ascxx/type.h
ViewVC logotype

Contents of /trunk/ascxx/type.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2579 - (show annotations) (download) (as text)
Wed Mar 14 23:05:32 2012 UTC (12 years, 6 months ago) by jpye
File MIME type: text/x-chdr
File size: 1493 byte(s)
Workaround for bug 494. Very close to the changes that Grivan suggested in changeset 3482.
ASCEND now working in Fedora 16 with SWIG 2.0.4.
1 #ifndef ASCXX_TYPE_H
2 #define ASCXX_TYPE_H
3
4 #include "config.h"
5
6 #include <vector>
7
8 extern "C"{
9 #include <ascend/compiler/type_desc.h>
10 }
11
12 class Simulation;
13 class Module;
14
15 #include "symchar.h"
16 #include "method.h"
17 #include "dimensions.h"
18
19 /**
20 A model type as loaded from an ASCEND a4c file. For example, a type
21 might be a 'test_controller' from the simple_fs.a4l example file.
22
23 Once you have a type, you can create an instance of it (getInstance)
24 which will then allow you to start on solving it.
25 */
26 class Type{
27 private:
28 const TypeDescription *t;
29 public:
30 Type();
31 Type(const TypeDescription *t);
32 const SymChar getName() const;
33 const int getParameterCount() const;
34 const TypeDescription *getInternalType() const;
35 // workaround for bug #494:
36 Simulation getSimulation(const SymChar &name, const bool rundefaultmethod);
37 //Simulation getSimulation(const SymChar &name="sim", const bool &rundefaultmethod=true);
38 const Dimensions getDimensions() const;
39 std::vector<Method> getMethods() const;
40 Method getMethod(const SymChar &name) const; ///< exception if not found
41 const bool isRefinedSolverVar() const; ///< is this type a refinement of solver_var?
42 const bool isRefinedAtom() const;
43 const bool isRefinedReal() const;
44 const bool isRefinedConstant() const;
45 const bool isFundamental() const;
46 const bool isModel() const;
47 const bool hasParameters() const;
48 const Type &findMember(const SymChar &name);
49
50 Module getModule() const;
51
52 bool operator<(const Type &other) const;
53 };
54
55 #endif

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22