/[escript]/trunk/escriptcore/src/EscriptParams.cpp
ViewVC logotype

Annotation of /trunk/escriptcore/src/EscriptParams.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2142 - (hide annotations)
Tue Dec 9 06:22:57 2008 UTC (10 years, 4 months ago) by jfenwick
Original Path: trunk/escript/src/EscriptParams.cpp
File size: 1399 byte(s)
Added showEscriptParams to output a list of available params.

1 jfenwick 1897
2    
3     /*******************************************************
4     *
5     * Copyright (c) 2003-2008 by University of Queensland
6     * Earth Systems Science Computational Center (ESSCC)
7     * http://www.uq.edu.au/esscc
8     *
9     * Primary Business: Queensland, Australia
10     * Licensed under the Open Software License version 3.0
11     * http://www.opensource.org/licenses/osl-3.0.php
12     *
13     *******************************************************/
14    
15 jfenwick 2142 #include "EscriptParams.h"
16 jfenwick 1897 #include <cstring>
17 jfenwick 2142 #include <boost/python/tuple.hpp>
18 jfenwick 1897
19     namespace escript
20     {
21    
22     EscriptParams escriptParams; // externed in header file
23    
24    
25     EscriptParams::EscriptParams()
26     {
27     too_many_lines=80;
28     }
29    
30     int
31     EscriptParams::getInt(const char* name, int sentinel) const
32     {
33     if (!strcmp(name,"TOO_MANY_LINES"))
34     {
35     return too_many_lines;
36     }
37     return sentinel;
38     }
39    
40     void
41     EscriptParams::setInt(const char* name, int value)
42     {
43     if (!strcmp(name,"TOO_MANY_LINES"))
44     {
45     too_many_lines=value;
46     }
47     }
48    
49     void
50     setEscriptParamInt(const char* name, int value)
51     {
52     escriptParams.setInt(name,value);
53     }
54    
55    
56     int
57     getEscriptParamInt(const char* name, int sentinel)
58     {
59     return escriptParams.getInt(name, sentinel);
60     }
61    
62 jfenwick 2142 boost::python::list
63     listEscriptParams()
64     {
65     using namespace boost::python;
66     boost::python::list l;
67     l.append(make_tuple("TOO_MANY_LINES","Maximum number of lines to output when printing data before printing a summary instead."));
68     return l;
69     }
70 jfenwick 1897
71 jfenwick 2142
72 jfenwick 1897 } // end namespace

  ViewVC Help
Powered by ViewVC 1.1.26