KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVRawDataReader.cpp
Go to the documentation of this file.
1 /*
2 $Id: KVRawDataReader.cpp,v 1.2 2007/05/31 09:59:22 franklan Exp $
3 $Revision: 1.2 $
4 $Date: 2007/05/31 09:59:22 $
5 */
6 
7 //Created by KVClassFactory on Wed May 16 15:52:21 2007
8 //Author: franklan
9 
10 #include "KVRawDataReader.h"
11 #include "KVBase.h"
12 #include "TPluginManager.h"
13 #include "TError.h"
14 
16 
17 
18 
19 
23 {
24  //Default constructor
25 }
26 
27 
28 
31 
33 {
34  //Destructor
35 }
36 
37 
38 
42 
44 {
45  // Generate an instance of a class to read raw data of given type
46  // corresponding to a defined plugin for KVRawDataReader
47 
48  TString base;
49  if (IsThisAPlugin(type, base)) {
50  if (base != "KVRawDataReader") {
51  ::Error("KVRawDataReader::OpenFile", "%s is plugin of wrong type (%s)", type.Data(), base.Data());
52  return nullptr;
53  }
54  TPluginHandler* ph = LoadPlugin(base, type);
55  if (ph) {
56  return (KVRawDataReader*)ph->ExecPlugin(1, filename.Data());
57  }
58  else {
59  ::Error("KVRawDataReader::OpenFile", "Failed to load plugin handler for %s", type.Data());
60  }
61  }
62  return nullptr;
63 }
64 
65 
66 
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
int type
static Bool_t IsThisAPlugin(const TString &uri, TString &base)
Definition: KVBase.cpp:1357
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
Definition: KVBase.cpp:793
Abstract base class for reading raw (DAQ) data.
static KVRawDataReader * OpenFile(const TString &type, const TString &filename)
virtual ~KVRawDataReader()
Destructor.
virtual void Error(const char *method, const char *msgfmt,...) const
Longptr_t ExecPlugin(int nargs, const T &... params)
const char * Data() const