• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

faspplugin/src/Factory.cxx (r4864/r3636)

Go to the documentation of this file.
00001 /********************************************************************
00002  * The Data Acquisition Backbone Core (DABC)
00003  ********************************************************************
00004  * Copyright (C) 2009-
00005  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
00006  * Planckstr. 1
00007  * 64291 Darmstadt
00008  * Germany
00009  * Contact:  http://dabc.gsi.de
00010  ********************************************************************
00011  * This software can be used under the GPL license agreements as stated
00012  * in LICENSE.txt file which is part of the distribution.
00013  ********************************************************************/
00014 
00015 #include "fasp/Factory.h"
00016 
00017 #include "dabc/Command.h"
00018 #include "dabc/logging.h"
00019 #include "dabc/Port.h"
00020 #include "dabc/ModuleSync.h"
00021 
00022 #include "base/Url.h"
00023 #include "fasp/FileInput.h"
00024 #include "fasp/Transport.h"
00025 
00026 dabc::FactoryPlugin rocfactory(new fasp::Factory("fasp"));
00027 
00028 fasp::Factory::Factory(const char* name) :
00029    dabc::Factory(name)
00030 {
00031 }
00032 
00033 
00034 dabc::Transport* fasp::Factory::CreateTransport(dabc::Reference ref, const char* typ, dabc::Command cmd)
00035 {
00036    if (strcmp(typ, "fasp::Transport")==0) {
00037       dabc::PortRef portref = ref;
00038       if (portref.null()) {
00039          EOUT(("Port not specified"));
00040          return 0;
00041       }
00042 
00043        // FIXME!
00044       fasp::Transport* tr = new fasp::Transport(portref, cmd);
00045 
00046       if (!tr->IsRawSocket()) { delete tr; tr = 0; }
00047 
00048       return tr;
00049    }
00050 
00051    return dabc::Factory::CreateTransport(ref, typ, cmd);
00052 }
00053 
00054 
00055 
00056 dabc::DataInput* fasp::Factory::CreateDataInput(const char* typ)
00057 {
00058    if ((typ==0) || (strlen(typ)==0)) return 0;
00059 
00060    DOUT3(("Factory::CreateDataInput %s", typ));
00061 
00062    if (strcmp(typ, "fasp::FileInput")==0) {
00063       return new fasp::FileInput();
00064    }
00065 
00066    return 0;
00067 }

Generated on Tue Dec 10 2013 04:52:22 for ROCsoft by  doxygen 1.7.1