CFEL - ASG Software Suite  2.5.0
CASS
data.h
Go to the documentation of this file.
1 // Copyright (C) 2014 Lutz Foucar
2 
3 /**
4  * @file data.h contains the base class for add viewer data
5  *
6  * @author Lutz Foucar
7  */
8 
9 #ifndef _JOCASSVIEWDATA_
10 #define _JOCASSVIEWDATA_
11 
12 #include <QtCore/QString>
13 
14 #include "result.hpp"
15 
16 namespace jocassview
17 {
18 /** base class for all data wrappers
19  *
20  * @author Lutz Foucar
21  */
22 class Data
23 {
24 public:
25  /** define the result type */
27 
28  /** constructor
29  *
30  * will set the _wasUpdated flag to false
31  */
32  Data();
33 
34  /** virtual destrutor */
35  virtual ~Data();
36 
37  /** fill the data with the result
38  *
39  * @param result the result to fill into this data container
40  */
41  virtual void setResult(result_t::shared_pointer result) = 0;
42 
43  /** retrieve the result
44  *
45  * @return pointer to the result
46  */
47  virtual result_t::shared_pointer result() = 0;
48 
49  /** set the source name
50  *
51  * @param name the sources type
52  */
53  virtual void setSourceName(const QString &name);
54 
55  /** retrieve the source name
56  *
57  * @return the source name for this data
58  */
59  virtual QString sourceName()const;
60 
61  /** retrieve was upDated flag
62  *
63  * @return true when the data was updated since the last call to result(),
64  * false otherwise
65  */
66  virtual bool wasUpdated() const;
67 
68 protected:
69  /** the name of the source */
71 
72  /** flag to tell whether the data was updated */
74 };
75 }//end namespace jocassview
76 
77 #endif
virtual void setSourceName(const QString &name)
set the source name
Definition: data.cpp:24
std::tr1::shared_ptr< self_type > shared_pointer
a shared pointer of this class
Definition: result.hpp:323
result classes
virtual QString sourceName() const
retrieve the source name
Definition: data.cpp:29
virtual void setResult(result_t::shared_pointer result)=0
fill the data with the result
virtual ~Data()
virtual destrutor
Definition: data.cpp:19
QString _sourceName
the name of the source
Definition: data.h:70
Data()
constructor
Definition: data.cpp:13
bool _wasUpdated
flag to tell whether the data was updated
Definition: data.h:73
virtual result_t::shared_pointer result()=0
retrieve the result
virtual bool wasUpdated() const
retrieve was upDated flag
Definition: data.cpp:34
base class for all data wrappers
Definition: data.h:22
cass::Result< float > result_t
define the result type
Definition: data.h:26