QXRD  0.11.16
qcepimagedataformatfactory.cpp
Go to the documentation of this file.
2 
3 #include "qcepimagedataformat.h"
4 
5 template <typename T>
7 
8 template <typename T>
10 
11 template <typename T>
13 {
14  if (! s_Created) {
15  s_Factory = new QcepImageDataFormatFactory<T>();
16  s_Created = true;
17  }
18 
19  return s_Factory;
20 }
21 
22 template <typename T>
24 {
25 }
26 
27 template <typename T>
29 {
30  s_Created = false;
31 }
32 
33 template <typename T>
35 {
36  m_Formats.append(fmt);
37 }
38 
39 template <typename T>
41 {
43  int priority = 0;
44  QcepImageDataFormat<T> *best=NULL;
45 
46  foreach(fmt, m_Formats) {
47  if (fmt->canLoadFile(path)) {
48  if (fmt->priority() > priority) {
49  best = fmt;
50  priority = fmt->priority();
51  }
52  }
53  }
54 
55  return best;
56 }
57 
61 template class QcepImageDataFormatFactory<int>;
static QxrdImageDataFormatHis fmt
static QcepImageDataFormatFactory< T > * factory()
QcepImageDataFormat< T > * canLoad(QString path)
void insert(QcepImageDataFormat< T > *f)
virtual Priority priority() const =0
virtual QcepImageDataFormat< T > * canLoadFile(QString path)=0