00001 #ifndef DDS_H 00002 #define DDS_H 00003 00005 // // 00006 // DDS // 00007 // // 00008 // Package: DDS (Data Dispatcher System). // 00009 // // 00010 // Concept: Define data types and static utility methods used by // 00011 // DDS package. // 00012 // // 00013 // S. Kasahara 05/2001 // 00014 // // 00016 00017 #include <string> 00018 #ifndef ROOT_Rtypes 00019 #if !defined(__CINT__) || defined(__MAKECINT__) 00020 #include "Rtypes.h" 00021 #endif 00022 #endif 00023 00024 namespace DDS { 00025 00026 // Define DDS Message Types. ROOT reserved message ids between 0-10000 in 00027 // $ROOTSYS/include/MessageTypes.h 00028 enum EMessageType { 00029 00030 // DDS parent server service request messages 00031 kData = 10001, // Request for online data 00032 00033 // DDS child server service request messages 00034 kGoToFile, // Advance to specified file 00035 kNext, // Request for next event 00036 kSubscribe, // Notify server of new subscription 00037 00038 // DDS parent or child server service request messages 00039 kShutdown, // Request to shutdown (parent or child) server 00040 00041 // DDS parent server service return status messages 00042 kPermissionDenied, // Unauthorized client access denied 00043 kSaturated, // Maximum number of concurrent clients reached 00044 00045 // DDS child server service return status messages 00046 kFileError, // Error in opening/reading online file 00047 kTimeoutNewFile, // Timeout reached while waiting for new file 00048 kTimeoutNewRecord, // Timeout reached while waiting for new record 00049 // from current file 00050 00051 // DDS parent or child server service return status messages 00052 kMessageUnknown, // Unrecognized message from client 00053 kOk, // Service provided successfully 00054 kSocketError, // Error in socket performance 00055 kSystemError, // Error in system call 00056 kError, // Generic error return 00057 00058 // DDS child server service return status message 00059 kInvalidSelection, // Invalid subscription selection string expression 00060 00061 // DDS parent server status request message 00062 kStatus, // Request for status 00063 00064 // DDS child server service return status message 00065 kInactive // Client connection shutdown due to inactivity 00066 }; 00067 00068 // Define supported data sources, these are used to determine location 00069 // of file to receive data from. 00070 enum EDataSource { 00071 kDaq, // Daq file 00072 kDcs // Dcs file 00073 }; 00074 00075 // Define subscription modes. 00076 enum EKeepUpMode { 00077 kAll, // Request all records from all files 00078 kFileKeepUp, // Request to keep up with most recent file 00079 kRecordKeepUp // Request most recent record set from file 00080 }; 00081 00082 // Define client types 00083 enum EClientType { 00084 kOnlineMonitor, // Online Monitor 00085 kDatabaseUpdater, // DBU 00086 kEventDisplay, // Event Display 00087 kOther, // Other 00088 kUnknownClientType // Not specified by client 00089 }; 00090 00091 const Int_t kPort = 9090; // Default port # for listening socket 00092 00093 const char* AsString(EDataSource datasource); 00094 const char* AsString(EKeepUpMode keepupmode); 00095 const char* AsString(EMessageType messagetype); 00096 const char* AsString(EClientType clienttype); 00097 00098 int GetKeepUpCode(const char* keepupmode); 00099 int GetDataSourceCode(const char* datasource); 00100 DDS::EClientType GetClientType(const char* clienttype); 00101 00102 } 00103 00104 #endif // DDS_H 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116
1.3.9.1