00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4EventServerFactory.h"
00017
00018 #include "TGo4Log.h"
00019
00020 #include "TGo4MbsEvent.h"
00021
00022 #include "TGo4EventStore.h"
00023 #include "TGo4FileStore.h"
00024 #include "TGo4BackStore.h"
00025 #include "TGo4TreeStore.h"
00026 #include "TGo4FileStoreParameter.h"
00027 #include "TGo4BackStoreParameter.h"
00028 #include "TGo4TreeStoreParameter.h"
00029
00030 #include "TGo4EventSource.h"
00031 #include "TGo4FileSource.h"
00032 #include "TGo4TreeSource.h"
00033 #include "TGo4MbsFile.h"
00034 #include "TGo4MbsStream.h"
00035 #include "TGo4MbsTransport.h"
00036 #include "TGo4MbsEventServer.h"
00037 #include "TGo4RevServ.h"
00038 #include "TGo4MbsRandom.h"
00039 #include "TGo4FileSourceParameter.h"
00040 #include "TGo4TreeSourceParameter.h"
00041 #include "TGo4MbsFileParameter.h"
00042 #include "TGo4MbsStreamParameter.h"
00043 #include "TGo4MbsTransportParameter.h"
00044 #include "TGo4MbsEventServerParameter.h"
00045 #include "TGo4RevServParameter.h"
00046 #include "TGo4MbsRandomParameter.h"
00047
00048
00049 TGo4EventServerFactory::TGo4EventServerFactory(const char* name)
00050 : TGo4EventFactory(name), fxEvent(0)
00051 {
00052 TRACE((15,"TGo4EventServerFactory::TGo4EventServerFactory(Text_t*)",__LINE__, __FILE__));
00053 }
00054
00055 TGo4EventServerFactory::TGo4EventServerFactory()
00056 : TGo4EventFactory("Go4 Event Server Factory"),fxEvent(0)
00057 {
00058 TRACE((15,"TGo4EventServerFactory::TGo4EventServerFactory()",__LINE__, __FILE__));
00059 }
00060
00061
00062 TGo4EventServerFactory::~TGo4EventServerFactory()
00063 {
00064 TRACE((15,"TGo4EventServerFactory::~TGo4EventServerFactory()",__LINE__, __FILE__));
00065 }
00066
00067 TGo4EventElement * TGo4EventServerFactory::CreateInputEvent()
00068 {
00069 TRACE((14,"TGo4EventServerFactory::CreateInputEvent()",__LINE__, __FILE__));
00070
00071
00072
00073
00074
00075
00076
00077
00078 TGo4MbsEvent* event = new TGo4MbsEvent(0, 0, 0, 0, 0);
00079 TGo4Log::Debug(" EventServer Factory: creating input event %s ",
00080 event->ClassName());
00081 return event;
00082
00083 }
00084
00085
00086 TGo4EventStore * TGo4EventServerFactory::CreateEventStore(TGo4EventStoreParameter* par)
00087 {
00088 TRACE((14,"TGo4EventServerFactory::CreateEventStore(TGo4EventStoreParameter*)",__LINE__, __FILE__));
00089
00090 TGo4EventStore* rev=0;
00091
00092 TGo4FileStore* fst=0;
00093 TGo4TreeStore* tst=0;
00094 fst=0;
00095 tst=0;
00096 if(par)
00097 {
00098 if(!strcmp(par->ClassName(),"TGo4FileStoreParameter"))
00099 {
00100 rev= new TGo4FileStore(dynamic_cast<TGo4FileStoreParameter* > (par) );
00101
00102 }
00103 else if(!strcmp(par->ClassName(),"TGo4TreeStoreParameter"))
00104 {
00105
00106 TGo4Log::Debug(" EventServer Factory: TreeStore is not recommended, PLEASE USE TGo4FileStore !!!! ");
00107 rev=0;
00108 }
00109 else if(!strcmp(par->ClassName(),"TGo4BackStoreParameter"))
00110 {
00111 rev= new TGo4BackStore(dynamic_cast<TGo4BackStoreParameter* > (par));
00112 }
00113
00114 else
00115 {
00116 rev = 0;
00117 }
00118 }
00119 else
00120 {
00121 rev = 0;
00122 }
00123
00124 if(rev)
00125 {
00126 TGo4Log::Debug(" EventServer Factory: creating event store %s ",
00127 rev->ClassName());
00128 }
00129 else
00130 {
00131 TGo4Log::Debug(" EventServer Factory: Unknown eventstore parameter ");
00132 }
00133 return rev;
00134
00135
00136
00137
00138 return rev;
00139
00140 }
00141
00142
00143 TGo4EventSource * TGo4EventServerFactory::CreateEventSource(TGo4EventSourceParameter * par)
00144 {
00145 TRACE((14,"TGo4EventServerFactory::CreateEventSource(TGo4EventSourceParameter*)",__LINE__, __FILE__));
00146
00147
00148 TGo4EventSource* rev=0;
00149
00150
00151 TGo4FileSource* fs=0;
00152 TGo4TreeSource* ts=0;
00153 TGo4MbsStream* ms=0;
00154 TGo4MbsFile* mf=0;
00155 TGo4MbsEventServer* es=0;
00156 TGo4MbsTransport* mst=0;
00157 TGo4RevServ* rs=0;
00158 TGo4MbsRandom* rm=0;
00159 fs=0;
00160 ts=0;
00161 ms=0;
00162 mf=0;
00163 es=0;
00164 mst=0;
00165 rs=0;
00166 rm=0;
00167
00168 if(par!=0)
00169 {
00170 if(!strcmp(par->ClassName(),"TGo4FileSourceParameter"))
00171 {
00172 rev= new TGo4FileSource(dynamic_cast<TGo4FileSourceParameter* > (par) );
00173 }
00174 else if(!strcmp(par->ClassName(),"TGo4TreeSourceParameter"))
00175 {
00176
00177 TGo4Log::Debug(" EventServer Factory: TreeSource is not recommended, PLEASE USE TGo4FileSource !!!! ");
00178 rev=0;
00179 }
00180 else if(!strcmp(par->ClassName(),"TGo4MbsFileParameter"))
00181 {
00182 rev= new TGo4MbsFile(dynamic_cast<TGo4MbsFileParameter* > (par) );
00183
00184 }
00185 else if(!strcmp(par->ClassName(),"TGo4MbsStreamParameter"))
00186 {
00187 rev= new TGo4MbsStream(dynamic_cast<TGo4MbsStreamParameter* > (par) );
00188 }
00189 else if(!strcmp(par->ClassName(),"TGo4MbsTransportParameter"))
00190 {
00191 rev= new TGo4MbsTransport(dynamic_cast<TGo4MbsTransportParameter* > (par) );
00192 }
00193 else if(!strcmp(par->ClassName(),"TGo4MbsEventServerParameter"))
00194 {
00195 rev= new TGo4MbsEventServer(dynamic_cast<TGo4MbsEventServerParameter* > (par) );
00196 }
00197
00198 else if(!strcmp(par->ClassName(),"TGo4RevServParameter"))
00199 {
00200 rev= new TGo4RevServ(dynamic_cast<TGo4RevServParameter* > (par) );
00201 }
00202 else if(!strcmp(par->ClassName(),"TGo4MbsRandomParameter"))
00203 {
00204 rev= new TGo4MbsRandom(dynamic_cast<TGo4MbsRandomParameter* > (par) );
00205 }
00206 else if(!strcmp(par->ClassName(),"TGo4UserSourceParameter"))
00207 {
00208 rev= new TGo4MbsRandom(par->GetName());
00209 }
00210 else
00211 {
00212 rev = 0;
00213 }
00214 }
00215
00216
00217 if(rev)
00218 {
00219 TGo4Log::Debug(" EventServer Factory: creating event source %s ",
00220 rev->ClassName());
00221 }
00222 else
00223 {
00224 TGo4Log::Debug(" EventServer Factory: Unknown eventsource parameter ");
00225 }
00226 return rev;
00227
00228 }
00229
00230
00231
00232
00233