~2591kuldeep/libdrizzle/libdrizzle-binlogapi

« back to all changes in this revision

Viewing changes to libdrizzle/event_data.cc

  • 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: Returns objects of every event
 
10
 *
 
11
 */
 
12
#include "config.h"
 
13
#include<iostream>
 
14
#include "libdrizzle/common.h"
 
15
#include "libdrizzle/commonapi.h"
 
16
#include <stdio.h>
 
17
#include <stdlib.h>
 
18
#include <errno.h>
 
19
#include <inttypes.h>
 
20
#include<string.h>
 
21
//#include<libdrizzle-5.1/event_data.h>
 
22
#define EVENT_DATA
 
23
using namespace std;
 
24
using namespace binlogevent;
 
25
 
 
26
void EventData::getTableMap(TableMapEvent& tableMap)
 
27
{
 
28
        tableMap.initWithData(_data);
 
29
}
 
30
 
 
31
void EventData::getUpdateEvent(RowEvent& updateEvent)
 
32
{
 
33
                updateEvent.setRowEventType(3); // type 3
 
34
                        updateEvent.initWithData(_data);
 
35
}
 
36
 
 
37
void EventData::getDeleteEvent(RowEvent& deleteEvent)
 
38
{
 
39
                deleteEvent.setRowEventType(2); // type 2
 
40
                        deleteEvent.initWithData(_data);
 
41
}
 
42
 
 
43
void EventData::getWriteEvent(RowEvent&  writeEvent)
 
44
{
 
45
                writeEvent.setRowEventType(1); // type 1
 
46
                        writeEvent.initWithData(_data);
 
47
}
 
48
 
 
49
void EventData::getQueryEvent(QueryEvent& queryEvent)
 
50
{
 
51
        queryEvent.initWithData(_data);
 
52
}
 
53
void EventData::getXidEvent(XidEvent& xidEvent)
 
54
{
 
55
        xidEvent.initWithData(_data);
 
56
}