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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2472 - (show annotations)
Thu Jun 11 23:33:47 2009 UTC (11 years, 2 months ago) by jfenwick
File MIME type: text/plain
File size: 3124 byte(s)
Added new params to control auto resolving for lazy data
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 #include "Data.h" // for the operators
19
20 namespace escript
21 {
22
23 class Data;
24 class DataLazy;
25
26 class EscriptParams
27 {
28 public:
29 ESCRIPT_DLL_API
30 EscriptParams();
31
32 ESCRIPT_DLL_API
33 int getInt(const char* name, int sentinel=0) const;
34
35 ESCRIPT_DLL_API
36 void setInt(const char* name, int value);
37
38 private:
39
40 // If we get more params we can replace this with a map
41 int too_many_lines;
42 int autolazy;
43 int too_many_levels;
44 int too_many_nodes;
45
46 protected:
47 // This is to provide fast access for methods in Data.
48 // Its a little bit ugly, needing all those friends but I really want to
49 // limit outside access to the char* interface
50
51 int getTOO_MANY_LINES() {return too_many_lines;}
52 int getAUTOLAZY() { return autolazy;}
53 int getTOO_MANY_LEVELS() {return too_many_levels;}
54 int getTOO_MANY_NODES() {return too_many_nodes;}
55
56 friend class escript::Data;
57 friend class escript::DataLazy;
58 friend Data operator+(const boost::python::api::object&, const escript::Data&);
59 friend Data operator-(const boost::python::api::object&, const escript::Data&);
60 friend Data operator*(const boost::python::api::object&, const escript::Data&);
61 friend Data operator/(const boost::python::api::object&, const escript::Data&);
62 friend Data operator+(const escript::Data&, const escript::Data&);
63 friend Data operator-(const escript::Data&, const escript::Data&);
64 friend Data operator*(const escript::Data&, const escript::Data&);
65 friend Data operator/(const escript::Data&, const escript::Data&);
66 friend Data operator+(const escript::Data&, const boost::python::api::object&);
67 friend Data operator-(const escript::Data&, const boost::python::api::object&);
68 friend Data operator*(const escript::Data&, const boost::python::api::object&);
69 friend Data operator/(const escript::Data&, const boost::python::api::object&);
70 friend Data C_GeneralTensorProduct(escript::Data& arg_0, escript::Data& arg_1,
71 int axis_offset, int transpose);
72
73 };
74
75
76 extern EscriptParams escriptParams;
77
78 /**
79 \brief Set the value of a named parameter.
80 See listEscriptParams() (showEscriptParams() in python) for available parameters.
81 */
82 ESCRIPT_DLL_API
83 void setEscriptParamInt(const char* name, int value);
84
85 /**
86 \brief get the value of a named parameter.
87 See listEscriptParams() (showEscriptParams() in python) for available parameters.
88 */
89 ESCRIPT_DLL_API
90 int getEscriptParamInt(const char* name, int sentinel=0);
91
92 /**
93 \brief describe available paramters.
94 \return a list of tuples (parameter name, description)
95 */
96 ESCRIPT_DLL_API
97 boost::python::list listEscriptParams();
98
99 }
100 #endif

  ViewVC Help
Powered by ViewVC 1.1.26