-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathicc_kette.h
117 lines (104 loc) · 3.9 KB
/
icc_kette.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* ICC Examin ist eine ICC Profil Betrachter
*
* Copyright (C) 2005-2008 Kai-Uwe Behrmann
*
* Autor: Kai-Uwe Behrmann <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* -----------------------------------------------------------------------------
*
* chain of profiles
*
*/
// Date: Januar 2005
#ifndef ICC_KETTE_H
#define ICC_KETTE_H
#include <string>
#include "icc_profile.h"
#include "icc_utils.h"
#include "icc_model_observer.h"
#include "icc_thread_daten.h"
#include "icc_speicher.h"
class ICCkette;
extern ICCkette profile;
class ICCkette : public icc_examin_ns::ThreadDaten,
public icc_examin_ns::Model
{
public:
ICCkette ();
void init ();
~ICCkette () {; }
void clear() {frei(false);
profile_.clear(); profilnamen_.clear();
aktiv_.clear(); profil_mzeit_.clear();
frei(true); }
private:
int aktuelles_profil_;
/** list of loaded profiles */
ICClist<ICCprofile> profile_;
ICClist<std::string> profilnamen_;
ICClist<int> aktiv_;
ICClist<double> profil_mzeit_;
/** Start a pthread observer, and let him inform all our observers,
which profile was just changed.
*/
static
//# if USE_THREADS
void*
/*# else
void
# endif*/
waechter (void*);
public:
bool einfuegen (const Speicher & profil, int pos);
void setzAktiv (int pos) { DBG_PROG aktiv_[pos]=true;}// benachrichtigen(pos);}
void passiv (int pos) { DBG_PROG aktiv_[pos]=false;}// benachrichtigen(pos);}
ICClist<int> aktiv () { return aktiv_; }
int aktiv (int pos) { return aktiv_[pos]; }
void aktuell (int pos) {
if(pos < (int)profile_.size())
aktuelles_profil_ = (pos > -1) ? pos : -1; }
int aktuell () { return aktuelles_profil_; }
ICCprofile* profil () { if (profile_.size()) {
return &(profile_[aktuelles_profil_]);
} else return 0; }
std::string name (int pos) {
if(profilnamen_.size() && pos < (int)profile_.size())
return profilnamen_[pos];
else return ""; }
std::string name () {
if(profilnamen_.size()) return profilnamen_[aktuelles_profil_];
else return ""; }
ICCprofile* operator [] (int n)
{ if (profile_.size() && n >= 0 && n < (int)profile_.size()) {
return &(profile_[n]);
} else return 0;
}
public:
/* operator ICCprofile () {
if(profile_.size()) return profile_[aktuelles_profil_];
else return ICCprofile(); }
operator std::string () {
if(profilnamen_.size()) return profilnamen_[aktuelles_profil_];
else return ""; }*/
operator ICClist<std::string> () {
return profilnamen_; }
operator int () {
return aktuelles_profil_; }
int size () {return (int)profile_.size(); }
};
#endif //ICC_KETTE_H