Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

IoDataStreamFactory.cxx

Go to the documentation of this file.
00001 
00002 // $Id: IoDataStreamFactory.cxx,v 1.8 2007/08/24 05:37:46 schubert Exp $
00003 //
00004 // messier@huhepl.harvard.edu
00006 #include <string>
00007 #include "Util/UtilString.h"
00008 #include "MessageService/MsgService.h"
00009 #include "IoModules/IoDataStreamFactory.h"
00010 #include "IoModules/IoInputStreamItr.h"
00011 #include "IoModules/IoRerootStreamItr.h"
00012 #include "IoModules/IoDDSStreamItr.h"
00013 #include "IoModules/IoDummyStreamItr.h"
00014 CVSID("$Id: IoDataStreamFactory.cxx,v 1.8 2007/08/24 05:37:46 schubert Exp $");
00016 
00017 IoDataStreamItr* 
00018 IoDataStreamFactory::CreateDataStreamItr(const char* source,
00019                                          const char* format,
00020                                          unsigned int port,
00021                                          unsigned int ddsmxretry,
00022                                          unsigned int ddsretrydelay,
00023                                          DDS::EClientType ddsclienttype,
00024                                          string ddsclientname)
00025 {
00026   IoDataStreamItr* itr = 0;
00027   std::string fmt(format);
00028   
00029   if ( UtilString::ToUpper(fmt) == "INPUT") {
00030     itr = new IoInputStreamItr(source);
00031   }
00032   if ( UtilString::ToUpper(fmt) == "REROOT") {
00033     itr = new IoRerootStreamItr(source);
00034   }
00035   if ( UtilString::ToUpper(fmt) == "DDS") {
00036     itr = new IoDDSStreamItr(source,port,ddsmxretry,ddsretrydelay,
00037                              ddsclienttype,ddsclientname);
00038   }
00039   if ( UtilString::ToUpper(fmt) == "DUMMY") {
00040     itr = new IoDummyStreamItr();
00041   }
00042   if (itr && itr->IsValid() ) return itr;
00043   
00044   MSG("Io",Msg::kWarning) 
00045       << "Failed to open data stream iterator of format " << format
00046       << endl;
00047 
00048   if ( itr ) delete itr;
00049 
00050   return 0;
00051 }
00052 

Generated on Mon Feb 15 11:06:48 2010 for loon by  doxygen 1.3.9.1