#include <DDSSubscription.h>
Public Types | |
| typedef std::map< TString, TString > | StreamMap |
| typedef StreamMap::iterator | StreamMapItr |
| typedef StreamMap::const_iterator | StreamMapConstItr |
Public Member Functions | |
| DDSSubscription (DDS::EDataSource datasource=DDS::kDaq, DDS::EKeepUpMode=DDS::kFileKeepUp) | |
| virtual | ~DDSSubscription () |
| DDS::EDataSource | GetDataSource () const |
| DDS::EKeepUpMode | GetKeepUpMode () const |
| const StreamMap & | GetStreamMap () const |
| Int_t | GetKeepUpWindow () const |
| UInt_t | GetNumStream () const |
| UInt_t | GetMaxSyncDelay () const |
| Bool_t | IsOffLine () const |
| std::ostream & | Print (std::ostream &ms) const |
| void | Print (Option_t *option="") const |
| void | SetDataSource (DDS::EDataSource datasource) |
| void | SetKeepUpMode (DDS::EKeepUpMode keepupmode) |
| void | SetOffLine (Bool_t offLine=true) |
| void | AddStream (Per::EStreamType streamtype, string selection="") |
| void | RemoveStream (Per::EStreamType streamtype) |
| void | Reset () |
| void | SetSelection (Per::EStreamType streamtype, std::string selection="") |
| void | SetSelection (std::string stream, std::string selection="") |
| void | SetMaxSyncDelay (UInt_t maxSyncDelay) |
| int | SetStreams (std::string streamlist) |
| void | SetKeepUpWindow (Int_t keepUpWindow) |
Private Attributes | |
| DDS::EDataSource | fDataSource |
| DDS::EKeepUpMode | fKeepUpMode |
| Bool_t | fOffLine |
| StreamMap | fStreamMap |
| UInt_t | fMaxSyncDelay |
| Int_t | fKeepUpWindow |
|
|
Definition at line 31 of file DDSSubscription.h. Referenced by GetStreamMap(). |
|
|
Definition at line 34 of file DDSSubscription.h. Referenced by Print(). |
|
|
Definition at line 33 of file DDSSubscription.h. Referenced by RemoveStream(). |
|
||||||||||||
|
Definition at line 54 of file DDSSubscription.cxx. 00055 : 00056 fDataSource(datasource),fKeepUpMode(keepupmode), 00057 fOffLine(false),fMaxSyncDelay(15),fKeepUpWindow(30) { 00058 // 00059 // Purpose: Default constructor for DDSSubscription class. 00060 // 00061 // Arguments: datasource defines source of data 00062 // (default = DDS::kDaq) 00063 // keepupmode enumerated keepup mode (default = DDS::kFileKeepUp) 00064 // 00065 // Return: n/a. 00066 // 00067 // Contact: S. Kasahara 00068 // 00069 00070 }
|
|
|
Definition at line 72 of file DDSSubscription.cxx. 00072 {
00073 // Purpose: Destructor.
00074 //
00075 // Argument: n/a.
00076 //
00077 // Return: n/a.
00078 //
00079 // Contact: S. Kasahara
00080 //
00081
00082 }
|
|
||||||||||||
|
Definition at line 33 of file DDSSubscription.cxx. References Per::AsString(). 00033 {
00034 //
00035 // Purpose: Add new stream to subscription list.
00036 //
00037 // Argument: streamtype stream of type Per::EStreamType to be added.
00038 // selection selection cut to be applied to entries in this
00039 // stream (default="" => no selection cuts applied).
00040 //
00041 // Return: none.
00042 //
00043 // Contact: S. Kasahara
00044 //
00045 // Notes: If the requested stream is already in subscription list, the
00046 // requested selection string is applied to the existing stream.
00047 //
00048
00049 // If streamtype is not already in map, this will add it
00050 fStreamMap[Per::AsString(streamtype)] = selection.c_str();
00051
00052 }
|
|
|
Definition at line 42 of file DDSSubscription.h. 00042 { return fDataSource; }
|
|
|
Definition at line 43 of file DDSSubscription.h. 00043 { return fKeepUpMode; }
|
|
|
Definition at line 45 of file DDSSubscription.h. 00045 { return fKeepUpWindow; }
|
|
|
Definition at line 47 of file DDSSubscription.h. 00047 { return fMaxSyncDelay; }
|
|
|
Definition at line 46 of file DDSSubscription.h. References fStreamMap. Referenced by Print(). 00046 { return fStreamMap.size(); }
|
|
|
Definition at line 44 of file DDSSubscription.h. References StreamMap. 00044 { return fStreamMap; }
|
|
|
Definition at line 48 of file DDSSubscription.h. Referenced by Print(). 00048 { return fOffLine; }
|
|
|
Definition at line 120 of file DDSSubscription.cxx. References Print(). 00120 {
00121 Print(std::cout);
00122 }
|
|
|
Definition at line 85 of file DDSSubscription.cxx. References DDS::AsString(), fDataSource, fKeepUpMode, fKeepUpWindow, fMaxSyncDelay, fStreamMap, GetNumStream(), IsOffLine(), and StreamMapConstItr. Referenced by operator<<(), and Print(). 00085 {
00086 //
00087 // Purpose: Print DDSSubscription status on std::ostream.
00088 //
00089 // Argument: ms std::ostream to print on.
00090 //
00091 // Return: std::ostream reference.
00092 //
00093 // Contact: S. Kasahara
00094 //
00095
00096 ms << " DataSource " << DDS::AsString(fDataSource) << "." << endl;
00097 ms << " KeepUpMode " << DDS::AsString(fKeepUpMode) << "." << endl;
00098 ms << " MaxSyncDelay " << fMaxSyncDelay << "." << endl;
00099 ms << " KeepUpWindow " << fKeepUpWindow << "." << endl;
00100 if (this -> IsOffLine()) ms << " OffLine true." << endl;
00101 else ms << " OffLine false." << endl;
00102
00103 ms << " Number of streams = " << GetNumStream() << endl;
00104 Int_t istream = 0;
00105 for (StreamMapConstItr citr = fStreamMap.begin(); citr != fStreamMap.end();
00106 ++citr) {
00107 ms << " " << ++istream << ")" << "Stream: " << citr->first << ".";
00108 if ( (citr -> second).IsNull() ) {
00109 ms << " No selection cut specified." << endl;
00110 }
00111 else {
00112 ms << " Selection cut: " << citr->second << "." << endl;
00113 }
00114 }
00115
00116 return ms;
00117
00118 }
|
|
|
Definition at line 124 of file DDSSubscription.cxx. References fStreamMap, and StreamMapItr. 00124 {
00125 //
00126 // Purpose: Remove stream from subscription list.
00127 //
00128 // Argument: streamtype requested stream
00129 //
00130 // Return: none.
00131 //
00132 // Contact: S. Kasahara
00133 //
00134
00135 StreamMapItr itr = fStreamMap.find(Per::AsString(streamtype));
00136 if (itr != fStreamMap.end()) {
00137 fStreamMap.erase(itr);
00138 }
00139
00140 }
|
|
|
Definition at line 142 of file DDSSubscription.cxx. References fStreamMap. Referenced by DDSChildServer::Subscribe(). 00142 {
00143 //
00144 // Purpose: Remove all streams from subscription list.
00145 //
00146 // Argument: none.
00147 //
00148 // Return: none.
00149 //
00150 // Contact: S. Kasahara
00151 //
00152
00153 fStreamMap.clear();
00154
00155 }
|
|
|
Definition at line 53 of file DDSSubscription.h. References fDataSource. Referenced by ReadDispatcherModule::ConnectToServer(), and main(). 00053 {fDataSource = datasource;}
|
|
|
Definition at line 54 of file DDSSubscription.h. References fKeepUpMode. Referenced by main(). 00054 {fKeepUpMode = keepupmode;}
|
|
|
Definition at line 63 of file DDSSubscription.h. References fKeepUpWindow. 00063 { fKeepUpWindow = keepUpWindow; }
|
|
|
Definition at line 61 of file DDSSubscription.h. References fMaxSyncDelay. 00061 { fMaxSyncDelay = maxSyncDelay; }
|
|
|
Definition at line 55 of file DDSSubscription.h. References fOffLine. 00055 { fOffLine = offLine; }
|
|
||||||||||||
|
Definition at line 179 of file DDSSubscription.cxx. References fStreamMap. 00179 {
00180 //
00181 // Purpose: Modify selection string for requested stream.
00182 //
00183 // Argument: stream streamname
00184 // selection selection cut to be applied to entries in this
00185 // stream (default ="" => no selection cuts applied).
00186 //
00187 // Return: none.
00188 //
00189 // Contact: S. Kasahara
00190 //
00191 // Notes: If the requested stream does not already exist in subscription
00192 // list, the stream is added to the list.
00193 //
00194
00195 // If streamtype is not already in map, this will add it
00196 fStreamMap[stream.c_str()] = selection.c_str();
00197
00198 }
|
|
||||||||||||
|
Definition at line 157 of file DDSSubscription.cxx. References Per::AsString(), and fStreamMap. 00157 {
00158 //
00159 // Purpose: Modify selection string for requested stream.
00160 //
00161 // Argument: streamtype stream of type Per::EStreamType.
00162 // selection selection cut to be applied to entries in this
00163 // stream (default ="" => no selection cuts applied).
00164 //
00165 // Return: none.
00166 //
00167 // Contact: S. Kasahara
00168 //
00169 // Notes: If the requested stream does not already exist in subscription
00170 // list, the stream is added to the list. (Hence this method
00171 // performs the same function as AddStream.)
00172 //
00173
00174 // If streamtype is not already in map, this will add it
00175 fStreamMap[Per::AsString(streamtype)] = selection.c_str();
00176
00177 }
|
|
|
Definition at line 200 of file DDSSubscription.cxx. References fStreamMap, and UtilString::StringTok(). Referenced by ReadDispatcherModule::ConnectToServer(), and main(). 00200 {
00201 //
00202 // Purpose: Set active streams in subscription to correspond to those
00203 // in delimiter separated (,;: ) streamList.
00204 //
00205 // Argument: streamList delimiter (,;: ) separated list of streams.
00206 //
00207 // Return: Number of streams set.
00208 //
00209 // Contact: S. Kasahara
00210 //
00211
00212
00213 fStreamMap.clear();
00214 std::vector<std::string> ls;
00215 UtilString::StringTok(ls,streamList,",:; ");
00216
00217 std::vector<std::string>::iterator vitr;
00218 for ( vitr = ls.begin(); vitr != ls.end(); vitr++ ) {
00219 fStreamMap[(*vitr).c_str()] = "";
00220 }
00221 return fStreamMap.size();
00222
00223 }
|
|
|
Definition at line 68 of file DDSSubscription.h. Referenced by Print(), and SetDataSource(). |
|
|
Definition at line 69 of file DDSSubscription.h. Referenced by Print(), and SetKeepUpMode(). |
|
|
Definition at line 73 of file DDSSubscription.h. Referenced by Print(), and SetKeepUpWindow(). |
|
|
Definition at line 72 of file DDSSubscription.h. Referenced by Print(), and SetMaxSyncDelay(). |
|
|
Definition at line 70 of file DDSSubscription.h. Referenced by SetOffLine(). |
|
|
Definition at line 71 of file DDSSubscription.h. Referenced by GetNumStream(), Print(), RemoveStream(), Reset(), SetSelection(), and SetStreams(). |
1.3.9.1