Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4EventServerFactory.h"
00015
00016 #include "TGo4Log.h"
00017
00018 #include "TGo4MbsEvent.h"
00019
00020 #include "TGo4EventStore.h"
00021 #include "TGo4FileStore.h"
00022 #include "TGo4BackStore.h"
00023 #include "TGo4TreeStore.h"
00024 #include "TGo4FileStoreParameter.h"
00025 #include "TGo4BackStoreParameter.h"
00026 #include "TGo4TreeStoreParameter.h"
00027
00028 #include "TGo4EventSource.h"
00029 #include "TGo4FileSource.h"
00030 #include "TGo4TreeSource.h"
00031 #include "TGo4MbsFile.h"
00032 #include "TGo4MbsStream.h"
00033 #include "TGo4MbsTransport.h"
00034 #include "TGo4MbsEventServer.h"
00035 #include "TGo4RevServ.h"
00036 #include "TGo4MbsRandom.h"
00037 #include "TGo4FileSourceParameter.h"
00038 #include "TGo4TreeSourceParameter.h"
00039 #include "TGo4MbsFileParameter.h"
00040 #include "TGo4MbsStreamParameter.h"
00041 #include "TGo4MbsTransportParameter.h"
00042 #include "TGo4MbsEventServerParameter.h"
00043 #include "TGo4RevServParameter.h"
00044 #include "TGo4MbsRandomParameter.h"
00045
00046
00047 TGo4EventServerFactory::TGo4EventServerFactory(const char* name) :
00048 TGo4EventFactory(name), fxEvent(0)
00049 {
00050 GO4TRACE((15,"TGo4EventServerFactory::TGo4EventServerFactory(const char*)",__LINE__, __FILE__));
00051 }
00052
00053 TGo4EventServerFactory::TGo4EventServerFactory() :
00054 TGo4EventFactory("Go4 Event Server Factory"),fxEvent(0)
00055 {
00056 GO4TRACE((15,"TGo4EventServerFactory::TGo4EventServerFactory()",__LINE__, __FILE__));
00057 }
00058
00059 TGo4EventServerFactory::~TGo4EventServerFactory()
00060 {
00061 GO4TRACE((15,"TGo4EventServerFactory::~TGo4EventServerFactory()",__LINE__, __FILE__));
00062 }
00063
00064 TGo4EventElement * TGo4EventServerFactory::CreateInputEvent()
00065 {
00066 GO4TRACE((14,"TGo4EventServerFactory::CreateInputEvent()",__LINE__, __FILE__));
00067
00068
00069
00070
00071
00072
00073
00074
00075 TGo4MbsEvent* event = new TGo4MbsEvent(0, 0, 0, 0, 0);
00076 TGo4Log::Debug(" EventServer Factory: creating input event %s ", event->ClassName());
00077 return event;
00078 }
00079
00080 TGo4EventStore * TGo4EventServerFactory::CreateEventStore(TGo4EventStoreParameter* par)
00081 {
00082 GO4TRACE((14,"TGo4EventServerFactory::CreateEventStore(TGo4EventStoreParameter*)",__LINE__, __FILE__));
00083
00084 TGo4EventStore* rev(0);
00085
00086 if(par) {
00087 if(!strcmp(par->ClassName(),"TGo4FileStoreParameter"))
00088 {
00089 rev = new TGo4FileStore(dynamic_cast<TGo4FileStoreParameter* > (par) );
00090 }
00091 else if(!strcmp(par->ClassName(),"TGo4TreeStoreParameter"))
00092 {
00093
00094 TGo4Log::Debug(" EventServer Factory: TreeStore is not recommended, PLEASE USE TGo4FileStore !!!! ");
00095 }
00096 else if(!strcmp(par->ClassName(),"TGo4BackStoreParameter"))
00097 {
00098 rev = new TGo4BackStore(dynamic_cast<TGo4BackStoreParameter* > (par));
00099 }
00100 }
00101
00102 if(rev)
00103 TGo4Log::Debug(" EventServer Factory: creating event store %s ", rev->ClassName());
00104 else
00105 TGo4Log::Debug(" EventServer Factory: Unknown eventstore parameter ");
00106
00107 return rev;
00108 }
00109
00110
00111 TGo4EventSource * TGo4EventServerFactory::CreateEventSource(TGo4EventSourceParameter * par)
00112 {
00113 GO4TRACE((14,"TGo4EventServerFactory::CreateEventSource(TGo4EventSourceParameter*)",__LINE__, __FILE__));
00114
00115
00116 TGo4EventSource* rev=0;
00117
00118 if(par!=0) {
00119 if(!strcmp(par->ClassName(),"TGo4FileSourceParameter"))
00120 {
00121 rev = new TGo4FileSource(dynamic_cast<TGo4FileSourceParameter* > (par) );
00122 }
00123 else if(!strcmp(par->ClassName(),"TGo4TreeSourceParameter"))
00124 {
00125
00126 TGo4Log::Debug(" EventServer Factory: TreeSource is not recommended, PLEASE USE TGo4FileSource !!!! ");
00127 }
00128 else if(!strcmp(par->ClassName(),"TGo4MbsFileParameter"))
00129 {
00130 rev = new TGo4MbsFile(dynamic_cast<TGo4MbsFileParameter* > (par) );
00131
00132 }
00133 else if(!strcmp(par->ClassName(),"TGo4MbsStreamParameter"))
00134 {
00135 rev = new TGo4MbsStream(dynamic_cast<TGo4MbsStreamParameter* > (par) );
00136 }
00137 else if(!strcmp(par->ClassName(),"TGo4MbsTransportParameter"))
00138 {
00139 rev = new TGo4MbsTransport(dynamic_cast<TGo4MbsTransportParameter* > (par) );
00140 }
00141 else if(!strcmp(par->ClassName(),"TGo4MbsEventServerParameter"))
00142 {
00143 rev = new TGo4MbsEventServer(dynamic_cast<TGo4MbsEventServerParameter* > (par) );
00144 }
00145
00146 else if(!strcmp(par->ClassName(),"TGo4RevServParameter"))
00147 {
00148 rev = new TGo4RevServ(dynamic_cast<TGo4RevServParameter* > (par) );
00149 }
00150 else if(!strcmp(par->ClassName(),"TGo4MbsRandomParameter"))
00151 {
00152 rev = new TGo4MbsRandom(dynamic_cast<TGo4MbsRandomParameter* > (par) );
00153 }
00154 else if(!strcmp(par->ClassName(),"TGo4UserSourceParameter"))
00155 {
00156 rev = new TGo4MbsRandom(par->GetName());
00157 }
00158 }
00159
00160 if(rev)
00161 TGo4Log::Debug(" EventServer Factory: creating event source %s ", rev->ClassName());
00162 else
00163 TGo4Log::Debug(" EventServer Factory: Unknown eventsource parameter ");
00164
00165 return rev;
00166 }