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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1897 - (hide annotations)
Mon Oct 20 00:32:30 2008 UTC (10 years, 11 months ago) by jfenwick
File size: 1114 byte(s)
Modified Data::toString() so it doesn't throw on DataEmpty.
Added setEscriptParamInt and getEscriptParamInt as free functions.
At the moment all they do is allow you to set the param TOO_MANY_LINES.
This is used to determine when printing a Data object will show you the 
points and when it will print a summary.

I've set the default value back to 80 lines.
If you need to see more lines use (in python):

setEscriptParamInt("TOO_MANY_LINES",80000)


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     #include <cstring>
16     #include "EscriptParams.h"
17    
18     namespace escript
19     {
20    
21     EscriptParams escriptParams; // externed in header file
22    
23    
24     EscriptParams::EscriptParams()
25     {
26     too_many_lines=80;
27     }
28    
29     int
30     EscriptParams::getInt(const char* name, int sentinel) const
31     {
32     if (!strcmp(name,"TOO_MANY_LINES"))
33     {
34     return too_many_lines;
35     }
36     return sentinel;
37     }
38    
39     void
40     EscriptParams::setInt(const char* name, int value)
41     {
42     if (!strcmp(name,"TOO_MANY_LINES"))
43     {
44     too_many_lines=value;
45     }
46     }
47    
48     void
49     setEscriptParamInt(const char* name, int value)
50     {
51     escriptParams.setInt(name,value);
52     }
53    
54    
55     int
56     getEscriptParamInt(const char* name, int sentinel)
57     {
58     return escriptParams.getInt(name, sentinel);
59     }
60    
61    
62     } // end namespace

  ViewVC Help
Powered by ViewVC 1.1.26