-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsqlChanOp.h
119 lines (87 loc) · 2.61 KB
/
sqlChanOp.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
117
118
119
/**
* sqlChanOp.h
*
* Author: Matthias Crauwels <[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.
*
* $Id$
*/
#ifndef __SQLCHANOP_H
#define __SQLCHANOP_H "$Id$"
#include <string>
#include "dbHandle.h"
#include "chanfix_config.h"
namespace gnuworld
{
namespace cf
{
class sqlManager;
class sqlChanOp {
public:
sqlChanOp(sqlManager*);
virtual ~sqlChanOp();
/*
* Methods to get data attributes.
*/
inline const std::string& getChannel() const
{ return channel ; }
inline const std::string& getAccount() const
{ return account ; }
inline const int& getPoints() const
{ return points ; }
inline const std::string& getLastSeenAs() const
{ return nickUserHost ; }
inline const time_t getTimeFirstOpped() const
{ return ts_firstopped ; }
inline const time_t getTimeLastOpped() const
{ return ts_lastopped ; }
inline const short& getDay(int _dayval) const
{ return day[_dayval] ; }
/*
* Methods to set data attributes.
*/
inline void setChannel(std::string _channel)
{ channel = _channel ; }
inline void setAccount(std::string _account)
{ account = _account ; }
inline void setPoints(short _points)
{ day[currentDay] = _points; calcTotalPoints(); }
inline void addPoint()
{ day[currentDay]++; calcTotalPoints(); }
inline void setLastSeenAs(std::string _nickUserHost)
{ nickUserHost = _nickUserHost ; }
inline void setTimeFirstOpped(time_t _ts_firstopped)
{ ts_firstopped = _ts_firstopped ; }
inline void setTimeLastOpped(time_t _ts_lastopped)
{ ts_lastopped = _ts_lastopped ; }
inline void setDay(int _dayval, short _pointsval)
{ day[_dayval] = _pointsval ; }
void setAllMembers(dbHandle*, int);
void calcTotalPoints();
private:
std::string channel;
std::string account;
std::string nickUserHost;
int points;
time_t ts_firstopped;
time_t ts_lastopped;
short day[DAYSAMPLES];
sqlManager* myManager;
}; // class
} // namespace cf
} // namespace gnuworld
#endif // __SQLCHANOP_H