AppRC.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef SYNTHESIS_APPRC_H
00029 #define SYNTHESIS_APPRC_H
00030
00031 #include <casa/aips.h>
00032 #include <casa/System/Casarc.h>
00033 #include <casa/sstream.h>
00034 #include <iostream.h>
00035
00036 using namespace std;
00037
00038 namespace casa {
00039 class AppRC
00040 {
00041 public:
00042 AppRC()
00043 :rc_p(NULL), rcCleanup(),addPID_p(False), deleteFile_p(True),
00044 id_p()
00045 {};
00046
00047 AppRC(const string& filename,
00048 const Bool addPID=False,
00049 const Bool deleteFile=True)
00050 :rc_p(NULL), rcCleanup(), deleteFile_p(deleteFile), id_p()
00051 {init(filename,addPID,deleteFile_p);};
00052
00053 ~AppRC();
00054
00055 void setID(const string& id) {id_p=id;};
00056 void init(const string& filename, const Bool addPID=False,
00057 const Bool deleteFile=True);
00058
00059 string get(const string& name);
00060 string get(const string& name, Int& val);
00061 string get(const string& name, Float& val);
00062 string get(const string& name, Double& val);
00063 void put(const string& name, const string& val);
00064 void put(const string& name, const Int& val);
00065 void put(const string& name, const Float& val);
00066 void put(const string& name, const Double& val);
00067
00068 private:
00069 Casarc *rc_p;
00070 CasarcCleanup rcCleanup;
00071 pid_t myPID_p, myTID_p;
00072 Bool addPID_p,deleteFile_p;
00073 string fileName_p, id_p;
00074 void setPID() { myPID_p = getpid ();}
00075 };
00076
00077 };
00078
00079 #endif //