summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-07-24 14:21:11 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-07-24 14:21:11 +0100
commit1a8117e9de2101e24c7b1ab9d0b794f71dec4c77 (patch)
treef8fcd10842788ad315036664f3462888120b6c41 /lib
parentFix up insert/delete SQL generation (diff)
downloadmygrate-1a8117e9de2101e24c7b1ab9d0b794f71dec4c77.tar.bz2
mygrate-1a8117e9de2101e24c7b1ab9d0b794f71dec4c77.tar.xz
mygrate-1a8117e9de2101e24c7b1ab9d0b794f71dec4c77.zip
Remove any default implementation for EventHandlerBase
Diffstat (limited to 'lib')
-rw-r--r--lib/eventHandlerBase.cpp7
-rw-r--r--lib/eventHandlerBase.h5
-rw-r--r--lib/output/dumpToConsole.cpp2
-rw-r--r--lib/output/dumpToConsole.h5
4 files changed, 7 insertions, 12 deletions
diff --git a/lib/eventHandlerBase.cpp b/lib/eventHandlerBase.cpp
index 56fad53..07d2c6a 100644
--- a/lib/eventHandlerBase.cpp
+++ b/lib/eventHandlerBase.cpp
@@ -2,12 +2,7 @@
#include <utility>
namespace MyGrate {
- void
- EventHandlerBase::tableMap(MyGrate::MariaDB_Event_Ptr event)
- {
- tableMaps.insert_or_assign(event->event.table_map.table_id, std::move(event));
- }
-
+ void EventHandlerBase::tableMap(MyGrate::MariaDB_Event_Ptr) { }
void EventHandlerBase::insertRow(MariaDB_Event_Ptr) { }
void EventHandlerBase::updateRow(MariaDB_Event_Ptr) { }
void EventHandlerBase::deleteRow(MariaDB_Event_Ptr) { }
diff --git a/lib/eventHandlerBase.h b/lib/eventHandlerBase.h
index 4bb2396..8f17e69 100644
--- a/lib/eventHandlerBase.h
+++ b/lib/eventHandlerBase.h
@@ -13,11 +13,6 @@ namespace MyGrate {
virtual void insertRow(MariaDB_Event_Ptr);
virtual void updateRow(MariaDB_Event_Ptr);
virtual void deleteRow(MariaDB_Event_Ptr);
-
- protected:
- using TableId = decltype(st_mariadb_rpl_table_map_event::table_id);
- using TableMaps = std::map<TableId, MyGrate::MariaDB_Event_Ptr>;
- TableMaps tableMaps;
};
}
diff --git a/lib/output/dumpToConsole.cpp b/lib/output/dumpToConsole.cpp
index 949c16f..656063b 100644
--- a/lib/output/dumpToConsole.cpp
+++ b/lib/output/dumpToConsole.cpp
@@ -17,7 +17,7 @@ namespace MyGrate::Output {
{
const auto & tm = event->event.table_map;
scprintf<"Table map %?.%? -> %?\n">(std::cout, tm.database, tm.table, tm.table_id);
- EventHandlerBase::tableMap(std::move(event));
+ tableMaps.insert_or_assign(event->event.table_map.table_id, std::move(event));
}
void
diff --git a/lib/output/dumpToConsole.h b/lib/output/dumpToConsole.h
index e3d51b6..bbbac44 100644
--- a/lib/output/dumpToConsole.h
+++ b/lib/output/dumpToConsole.h
@@ -16,8 +16,13 @@ namespace MyGrate::Output {
void deleteRow(MyGrate::MariaDB_Event_Ptr event) override;
private:
+ using TableId = decltype(st_mariadb_rpl_table_map_event::table_id);
+ using TableMaps = std::map<TableId, MyGrate::MariaDB_Event_Ptr>;
+
void dumpRowData(const st_mariadb_rpl_rows_event & row) const;
void dumpRowPairData(const st_mariadb_rpl_rows_event & row) const;
+
+ TableMaps tableMaps;
};
}