CFEL - ASG Software Suite  2.5.0
CASS
data_source.h
Go to the documentation of this file.
1 // Copyright (C) 2014 Lutz Foucar
2 
3 /**
4  * @file data_source.h contains the base class data sources
5  *
6  * @author Lutz Foucar
7  */
8 
9 #ifndef _DATASOURCE_
10 #define _DATASOURCE_
11 
12 #include <QtGlobal>
13 #include <QtCore/QString>
14 #include <QtCore/QStringList>
15 
16 #include "result.hpp"
17 
18 class QString;
19 
20 namespace jocassview
21 {
22 /** base class for data sources
23  *
24  * @author Lutz Foucar
25  */
27 {
28 public:
29  /** define the result type */
31 
32  /** retrieve a result from the source
33  *
34  * @param key the key of the result
35  * @param id The event id of the result
36  */
37  virtual result_t::shared_pointer result(const QString &key, quint64 id=0) = 0;
38 
39  /** retrieve the list items that can be displayed
40  *
41  * @return the list of strings that name the items that can be displayed
42  */
43  virtual QStringList resultNames() = 0;
44 
45  /** return the type of this source
46  *
47  * @return the type of the source
48  */
49  virtual QString type()const=0;
50 };
51 }//end namespace jocassview
52 
53 #endif
std::tr1::shared_ptr< self_type > shared_pointer
a shared pointer of this class
Definition: result.hpp:323
result classes
base class for data sources
Definition: data_source.h:26
virtual result_t::shared_pointer result(const QString &key, quint64 id=0)=0
retrieve a result from the source
cass::Result< float > result_t
define the result type
Definition: data_source.h:30
virtual QString type() const =0
return the type of this source
virtual QStringList resultNames()=0
retrieve the list items that can be displayed