casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AppRC.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //# AppRC.h: Definition of the AppRC class
3 //# Copyright (C) 1997,1998,1999,2000,2001,2002,2003
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id$
28 #ifndef SYNTHESIS_APPRC_H
29 #define SYNTHESIS_APPRC_H
30 
31 #include <casa/aips.h>
32 #include <casa/System/Casarc.h>
33 #include <casa/sstream.h>
34 #include <iostream>
35 #include <unistd.h>
36 
37 using namespace std;
38 
39 namespace casa { //# NAMESPACE CASA - BEGIN
40  class AppRC
41  {
42  public:
44  :rc_p(NULL), addPID_p(false), deleteFile_p(false),
45  id_p()
46  {init("", addPID_p, deleteFile_p);};
47 
48  AppRC(const string& filename,
49  const casacore::Bool addPID=false,
50  const casacore::Bool deleteFile=false)
51  :rc_p(NULL), deleteFile_p(deleteFile), id_p()
52  {init(filename,addPID,deleteFile_p);};
53 
54  ~AppRC();
55 
57  //returns Bytes available (reason why it is a double)
58  static casacore::Double getMemoryAvailable(string envVarName="CASA_MAX_MEMORY");
59  void setID(const string& id) {id_p=id;};
60  void init(const string& filename, const casacore::Bool addPID=false,
61  const casacore::Bool deleteFile=true);
62 
63  string get(const string& name);
64  string get(const string& name, casacore::Int& val);
65  string get(const string& name, casacore::Float& val);
66  string get(const string& name, casacore::Double& val);
67  void put(const string& name, const string& val);
68  void put(const string& name, const casacore::Int& val);
69  void put(const string& name, const casacore::Float& val);
70  void put(const string& name, const casacore::Double& val);
71 
72  private:
75  pid_t myPID_p /*, myTID_p*/;
77  string fileName_p, id_p;
78  void setPID() {/*myTID_p = gettid_p ();*/ myPID_p = getpid ();}
79  };
80 
81 }; //# NAMESPACE CASA - END
82 
83 #endif //
int Int
Definition: aipstype.h:50
string id_p
Definition: AppRC.h:77
void setID(const string &id)
Definition: AppRC.h:59
casacore::Bool deleteFile_p
Definition: AppRC.h:76
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
void setPID()
Definition: AppRC.h:78
double Double
Definition: aipstype.h:55
casacore::Casarc * rc_p
Definition: AppRC.h:73
AppRC(const string &filename, const casacore::Bool addPID=false, const casacore::Bool deleteFile=false)
Definition: AppRC.h:48
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
casacore::CasarcCleanup rcCleanup
Definition: AppRC.h:74
AppRC()
Definition: AppRC.h:43