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