00001 #include "SctNames.h"
00002
00003 #include <mrs/message.h>
00004 #include <cstdlib>
00005
00006 using namespace std;
00007
00008 namespace Sct {
00009
00010 string SctNames::getPartitionName() throw() {
00011 return "SCT";
00012 }
00013
00014 string SctNames::getEventDataName() throw() {
00015 return "EventData";
00016 }
00017
00018 string SctNames::getFittedDataName() throw() {
00019 return "FittedData";
00020 }
00021
00022 string SctNames::getDcsServerName() throw() {
00023 return "SCTDCS_Data";
00024 }
00025
00026 string SctNames::getTestDataName() throw() {
00027 return "TestData";
00028 }
00029
00030 string SctNames::getControlDataName() throw() {
00031 return "ControlData";
00032 }
00033
00034 string SctNames::getRetrievedDataName() throw() {
00035 return "RetrievedData";
00036 }
00037
00038 string SctNames::getTempDir() throw() {
00039 static std::string dir = getenv("SCT_SCRATCH_DIR") ? getenv("SCT_SCRATCH_DIR") : "/tmp";
00040 return dir;
00041 }
00042
00043 std::string SctNames::getPersistentDir() throw(){
00044 return m_persistent_dir;
00045 }
00046
00047 void SctNames::setPersistentDir(const char* newDirectory) throw(){
00048 m_persistent_dir = newDirectory;
00049 }
00050
00051 string SctNames::m_persistent_dir = getenv("SCT_PERSISTENT_DIR") ? getenv ("SCT_PERSISTENT_DIR") : "/tmp";
00052
00053
00054 std::string SctNames::getLogDir() throw(){
00055 static std::string dir = getenv("TDAQ_LOGS_PATH") ? getenv ("TDAQ_LOGS_PATH") : "/tmp";
00056 return dir;
00057 }
00058
00059 string SctNames::getLocation() throw() {
00060 return "Oxford";
00061 }
00062
00063 string SctNames::getUser() throw() {
00064 return "daquser";
00065 }
00066
00067 IPCPartition& SctNames::getPartition() throw() {
00068 static IPCPartition partition (getPartitionName());
00069 return partition;
00070 }
00071
00072 ISInfoDictionary& SctNames::getISDictionary() throw() {
00073 static ISInfoDictionary dictionary(getPartition());
00074 return dictionary;
00075 }
00076
00077 MRSStream& SctNames::Mrs() {
00078 static MRSStream mrs(getPartition());
00079 return mrs;
00080 }
00081
00082 static void dummyMRSCallBack(MRSCallbackMsg *mc) {
00083 std::cout << "Ignore this: Got message while testing MRS availability\n";
00084 }
00085
00086 bool SctNames::isMrsValid() {
00087
00088
00089
00090
00091
00092 IPCPartition p("SCT");
00093 return p.isValid();
00094 }
00095
00096 }