~2591kuldeep/libdrizzle/libdrizzle-binlogapi

« back to all changes in this revision

Viewing changes to libdrizzle-5.1/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
#ifndef EVENT_HEADER
 
27
#define EVENT_HEADER
 
28
 
 
29
namespace binlogevent
 
30
{
 
31
        class EventHeader 
 
32
        {
 
33
                public:
 
34
 
 
35
                        EventHeader():
 
36
                                timestamp(-1),
 
37
                                type(-1),
 
38
                                server_id(-1),
 
39
                                event_size(-1),
 
40
                                log_pos(-1),
 
41
                                flag(-1)
 
42
                        {
 
43
                        }
 
44
 
 
45
                        ~EventHeader()
 
46
                        {
 
47
                        }
 
48
 
 
49
                        DRIZZLE_API
 
50
                        int setHeader(unsigned const char* data);
 
51
 
 
52
                        friend class TableMapEvent;
 
53
                        friend class RowEvent;
 
54
                        friend class QueryEvent;
 
55
                        friend class XidEvent;
 
56
 
 
57
                private:
 
58
                        uint32_t timestamp; // timestamp of event
 
59
                        uint8_t type;       // type of event
 
60
                        uint32_t server_id; // server-id of the originating mysql-server. Used to filter out events in circular replication
 
61
                        uint32_t event_size;//size of the event (header, post-header, body) 
 
62
                        uint32_t log_pos;   // position of next event
 
63
                        uint16_t flag;    //header
 
64
 
 
65
 
 
66
        };
 
67
} /*namespace binlogevent*/
 
68
#endif