/[escript]/trunk/escript/src/EscriptParams.h
ViewVC logotype

Contents of /trunk/escript/src/EscriptParams.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2146 - (show annotations)
Wed Dec 10 02:59:46 2008 UTC (11 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 2966 byte(s)
Replaced duplicate code in Data with macro calls.
Added AUTOLAZY parameter (defaults to off for now.)
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14 #ifndef escript_EscriptParams_H
15 #define escript_EscriptParams_H
16 #include "system_dep.h"
17 #include <boost/python/list.hpp>
18
19 namespace escript
20 {
21
22 class Data;
23
24 class EscriptParams
25 {
26 public:
27 ESCRIPT_DLL_API
28 EscriptParams();
29
30 ESCRIPT_DLL_API
31 int getInt(const char* name, int sentinel=0) const;
32
33 ESCRIPT_DLL_API
34 void setInt(const char* name, int value);
35
36 private:
37
38 // If we get more params we can replace this with a map
39 int too_many_lines;
40 int autolazy;
41
42 protected:
43 // This is to provide fast access for methods in Data.
44 // Its a little bit ugly, needing all those friends but I really want to
45 // limit outside access to the char* interface
46
47 int getTOO_MANY_LINES() {return too_many_lines;}
48 int getAUTOLAZY() { return autolazy;}
49
50 friend class escript::Data;
51 friend escript::Data escript::operator+(const boost::python::api::object&, const escript::Data&);
52 friend escript::Data escript::operator-(const boost::python::api::object&, const escript::Data&);
53 friend escript::Data escript::operator*(const boost::python::api::object&, const escript::Data&);
54 friend escript::Data escript::operator/(const boost::python::api::object&, const escript::Data&);
55 friend escript::Data escript::operator+(const escript::Data&, const escript::Data&);
56 friend escript::Data escript::operator-(const escript::Data&, const escript::Data&);
57 friend escript::Data escript::operator*(const escript::Data&, const escript::Data&);
58 friend escript::Data escript::operator/(const escript::Data&, const escript::Data&);
59 friend escript::Data escript::operator+(const escript::Data&, const boost::python::api::object&);
60 friend escript::Data escript::operator-(const escript::Data&, const boost::python::api::object&);
61 friend escript::Data escript::operator*(const escript::Data&, const boost::python::api::object&);
62 friend escript::Data escript::operator/(const escript::Data&, const boost::python::api::object&);
63
64 };
65
66
67 extern EscriptParams escriptParams;
68
69 /**
70 \brief Set the value of a named parameter.
71 See listEscriptParams() (showEscriptParams() in python) for available parameters.
72 */
73 ESCRIPT_DLL_API
74 void setEscriptParamInt(const char* name, int value);
75
76 /**
77 \brief get the value of a named parameter.
78 See listEscriptParams() (showEscriptParams() in python) for available parameters.
79 */
80 ESCRIPT_DLL_API
81 int getEscriptParamInt(const char* name, int sentinel=0);
82
83 /**
84 \brief describe available paramters.
85 \return a list of tuples (parameter name, description)
86 */
87 ESCRIPT_DLL_API
88 boost::python::list listEscriptParams();
89
90 }
91 #endif

  ViewVC Help
Powered by ViewVC 1.1.26