Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: compiled/tools.h

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Patch Set: Created Jan. 14, 2016, 4:40 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « compiled/pre.js ('k') | compiled/tools.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef ADBLOCKPLUS_TOOLS_H
2 #define ADBLOCKPLUS_TOOLS_H
3
4 #include <emscripten.h>
5 #include <cstddef>
6 #include <string>
7
8 #define PROPERTY(classprefix, type, name) \
9 private:\
10 type name;\
11 public:\
12 type get_##name()\
13 {\
14 return name;\
15 }\
16 void set_##name(type value)\
17 {\
18 if (name != value)\
19 {\
20 type oldvalue = value;\
21 name = value;\
22 /* TODO FilterNotifier.triggerListeners(#classprefix "." #name, this, value, oldValue); */\
23 }\
24 }
25
26 #define EXPOSE_PROPERTY(class, t, name) \
27 t EMSCRIPTEN_KEEPALIVE class##_get_##name(class* obj)\
28 {\
29 return obj->get_##name();\
30 }\
31 void EMSCRIPTEN_KEEPALIVE class##_set_##name(class* obj, t value)\
32 {\
33 obj->set_##name(value);\
34 }
35
36 #define FILTER_PROPERTY(type, name) PROPERTY(filter, type, name)
37
38 char16_t* stringToBuffer(const std::u16string& str, size_t* resultLen);
39
40 #endif
OLDNEW
« no previous file with comments | « compiled/pre.js ('k') | compiled/tools.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld