~2591kuldeep/libdrizzle/libdrizzle-binlogapi

« back to all changes in this revision

Viewing changes to libdrizzle/binlogevent/event_header.h

  • Committer: kuldeep
  • Date: 2013-09-19 22:27:25 UTC
  • Revision ID: kuldeep@kuldeep-laptop-20130919222725-xsb4tlxp0tp3mm2t
Adding Tested code on local environment, now we can access the new api functions within library

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
2
 
 * Copyright (C) 2013 Drizzle Developer Group
3
 
 * Copyright (C) 2013 Kuldeep Porwal
4
 
 * All rights reserved.
5
 
 *
6
 
 * Use and distribution licensed under the BSD license.  See
7
 
 * the COPYING file in the parent directory for full text.
8
 
 *
9
 
 * summary: parsing of header (common for each event)
10
 
 *
11
 
 */
12
 
#include<iostream>
13
 
#include<cstring>
14
 
#include<inttypes.h>
15
 
 
16
 
#ifndef HELPER
17
 
#define HELPER
18
 
 
19
 
#include"helper.h"
20
 
 
21
 
#endif
22
 
 
23
 
 
24
 
using namespace std;
25
 
 
26
 
namespace binlogevent
27
 
{
28
 
        class EventHeader 
29
 
        {
30
 
                public:
31
 
 
32
 
                        EventHeader():
33
 
                                timestamp(-1),
34
 
                                type(-1),
35
 
                                server_id(-1),
36
 
                                event_size(-1),
37
 
                                log_pos(-1),
38
 
                                flag(-1)
39
 
                        {
40
 
                        }
41
 
 
42
 
                        ~EventHeader()
43
 
                        {
44
 
                        }
45
 
 
46
 
                        int setHeader(unsigned const char* data);
47
 
 
48
 
                        friend class TableMapEvent;
49
 
                        friend class RowEvent;
50
 
                        friend class QueryEvent;
51
 
                        friend class XidEvent;
52
 
 
53
 
                private:
54
 
                        uint32_t timestamp; // timestamp of event
55
 
                        uint8_t type;       // type of event
56
 
                        uint32_t server_id; // server-id of the originating mysql-server. Used to filter out events in circular replication
57
 
                        uint32_t event_size;//size of the event (header, post-header, body) 
58
 
                        uint32_t log_pos;   // position of next event
59
 
                        uint16_t flag;    //header
60
 
 
61
 
 
62
 
        };
63
 
} /*namespace binlogevent*/
64