DLS  1.6
JobPreset.h
1 /******************************************************************************
2  *
3  * This file is part of the Data Logging Service (DLS).
4  *
5  * DLS is free software: you can redistribute it and/or modify it under the
6  * terms of the GNU General Public License as published by the Free Software
7  * Foundation, either version 3 of the License, or (at your option) any later
8  * version.
9  *
10  * DLS is distributed in the hope that it will be useful, but WITHOUT ANY
11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with DLS. If not, see <http://www.gnu.org/licenses/>.
17  *
18  *****************************************************************************/
19 
20 #ifndef LibDLSJobPresetH
21 #define LibDLSJobPresetH
22 
23 /*****************************************************************************/
24 
25 #include <stdint.h>
26 
27 #include <string>
28 #include <vector>
29 
30 /*****************************************************************************/
31 
32 #include "Exception.h"
33 #include "ChannelPreset.h"
34 #include "globals.h"
35 
36 /*****************************************************************************/
37 
38 namespace DlsProto {
39  class JobPresetInfo;
40 }
41 
42 namespace LibDLS {
43 
44 /*****************************************************************************/
45 
49  public Exception
50 {
51  public:
52  EJobPreset(const std::string &pmsg):
53  Exception(pmsg) {};
54 };
55 
56 /*****************************************************************************/
57 
65 {
66  public:
67  JobPreset();
68  ~JobPreset();
69 
70  void import(const std::string &, unsigned int);
71  void import_from(const DlsProto::JobPresetInfo &);
72 
73  unsigned int id() const { return _id; }
74  const std::string &description() const { return _description; }
75  std::string id_desc() const;
76  const std::string &owner() const { return _owner; }
77  bool running() const { return _running; }
78  uint64_t quota_time() const { return _quota_time; }
79  uint64_t quota_size() const { return _quota_size; }
80  const std::string &source() const { return _source; }
81  uint16_t port() const { return _port; }
82  const std::string &trigger() const { return _trigger; }
83  const std::vector<ChannelPreset> *channels() const {
84  return &_channels;
85  }
86  bool channel_exists(const std::string &) const;
87  void set_job_preset_info(DlsProto::JobPresetInfo *) const;
88 
89  protected:
90  unsigned int _id;
91  std::string _description;
92  std::string _owner;
93  bool _running;
94  uint64_t _quota_time;
95  uint64_t _quota_size;
96  std::string _source;
97  uint16_t _port;
98  std::string _trigger;
100  std::vector<ChannelPreset> _channels;
101 };
102 
103 /*****************************************************************************/
104 
105 } // namespace
106 
107 /*****************************************************************************/
108 
109 #endif
uint64_t _quota_size
Auftrags-Quota nach Datengröße.
Definition: JobPreset.h:95
std::string _description
Beschreibender Name des Auftrages.
Definition: JobPreset.h:91
Base class for all LibDLS exceptions.
Definition: Exception.h:36
Auftragsvorgaben mit Liste der Kanalvorgaben.
Definition: JobPreset.h:64
std::string _owner
Besitzer des Auftrages.
Definition: JobPreset.h:92
Global data structures and functions.
uint64_t _quota_time
Auftrags-Quota nach Zeit.
Definition: JobPreset.h:94
Job preset exception.
Definition: JobPreset.h:48
uint16_t _port
Port der Datenquelle.
Definition: JobPreset.h:97
std::string _source
IP-Adresse oder Hostname der Datenquelle.
Definition: JobPreset.h:96
Definition: Channel.h:44
std::string _trigger
Name des Trigger-Parameters, andernfalls leer.
Definition: JobPreset.h:98
bool _running
Soll erfasst werden?
Definition: JobPreset.h:93
std::vector< ChannelPreset > _channels
Liste der Kanalvorgaben.
Definition: JobPreset.h:100
#define DLS_PUBLIC
Macro for public method definitions (empty on non-win32).
Definition: globals.h:57
unsigned int _id
Job ID.
Definition: JobPreset.h:90