]> git.stg.codes - stg.git/blob - include/stg/message.h
Add Boost to Travis.
[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 <cstdint>
15 #include <string>
16
17 //-----------------------------------------------------------------------------
18 struct STG_MSG_HDR
19 {
20 STG_MSG_HDR()
21     : id(0),
22       ver(0),
23       type(0),
24       lastSendTime(0),
25       creationTime(0),
26       showTime(0),
27       repeat(0),
28       repeatPeriod(0)
29 {}
30
31 uint64_t    id;
32 unsigned    ver;
33 unsigned    type;
34 unsigned    lastSendTime;
35 unsigned    creationTime;
36 unsigned    showTime;
37 int         repeat;
38 unsigned    repeatPeriod;
39 };
40 //-----------------------------------------------------------------------------
41 struct STG_MSG
42 {
43 STG_MSG() : header(), text() {}
44
45 time_t GetNextSendTime() const
46 {
47 return header.lastSendTime + header.repeat * 60;
48 }
49
50 STG_MSG_HDR header;
51 std::string text;
52 };
53 //-----------------------------------------------------------------------------
54
55 #endif