]> git.stg.codes - stg.git/blob - include/stg/message.h
TUT framework updated to svn version
[stg.git] / include / stg / message.h
1 #ifndef STG_MESSAGES_H
2 #define STG_MESSAGES_H
3
4 /*
5  *    Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
6  */
7
8  /*
9  $Revision: 1.3 $
10  $Date: 2010/03/04 11:49:52 $
11  */
12
13 #include <ctime>
14 #include <string>
15
16 #include "os_int.h"
17
18 //-----------------------------------------------------------------------------
19 struct STG_MSG_HDR
20 {
21 STG_MSG_HDR()
22     : id(0),
23       ver(0),
24       type(0),
25       lastSendTime(0),
26       creationTime(0),
27       showTime(0),
28       repeat(0),
29       repeatPeriod(0)
30 {}
31
32 uint64_t    id;
33 unsigned    ver;
34 unsigned    type;
35 unsigned    lastSendTime;
36 unsigned    creationTime;
37 unsigned    showTime;
38 int         repeat;
39 unsigned    repeatPeriod;
40 };
41 //-----------------------------------------------------------------------------
42 struct STG_MSG
43 {
44 STG_MSG() : header(), text() {}
45
46 time_t GetNextSendTime() const
47 {
48 return header.lastSendTime + header.repeat * 60;
49 }
50
51 STG_MSG_HDR header;
52 std::string text;
53 };
54 //-----------------------------------------------------------------------------
55
56 #endif