@@ -26,7 +26,9 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
2626EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727*/
2828
29- #pragma once
29+ // AUTOMATICALLY GENERATED FILE - DO NOT EDIT!
30+
31+ #include <{base_name}.h>
3032
3133// macro to support compiled specification
3234#define NONE ((unsigned)-1)
@@ -47,63 +49,93 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4749// group --------------------------------------------------------------------------------------
4850#define TAG_INFO_FUNC(name) \
4951static unsigned name ## _tag_info_func(const unsigned tag) \
50- { \
52+ {{ \
5153 switch(tag) \
52- {
54+ {{
5355
5456#define END_TAG_INFO \
5557 default: return NONE; \
56- } \
57- }
58+ }} \
59+ }}
5860
5961#define GROUP_INFO_FUNC(name) \
6062static const fix_group_info* name ## _group_info_func(const unsigned tag) \
61- { \
63+ {{ \
6264 switch(tag) \
63- {
65+ {{
6466
6567#define GROUP_INFO(len_tag_name, group_name) \
6668 case len_tag_name: return &group_name ## _group_info;
6769
6870#define END_GROUP_INFO \
6971 default: return NULL; \
70- } \
71- }
72+ }} \
73+ }}
7274
7375#define GROUP_INFO_STRUCT(name, node_size, first_tag) \
7476static const fix_group_info \
75- name ## _group_info = { (node_size), (first_tag), name ## _tag_info_func, name ## _group_info_func };
77+ name ## _group_info = {{ (node_size), (first_tag), name ## _tag_info_func, name ## _group_info_func } };
7678
7779#define EMPTY_GROUP_INFO(name, node_size, first_tag) \
7880static const fix_group_info \
79- name ## _group_info = { (node_size), (first_tag), name ## _tag_info_func, empty_group_info_func };
81+ name ## _group_info = {{ (node_size), (first_tag), name ## _tag_info_func, empty_group_info_func } };
8082
8183// message ---------------------------------------------------------------------------------------
8284#define MESSAGE_TAG_INFO_FUNC TAG_INFO_FUNC
8385
8486#define END_MESSAGE_TAG_INFO \
8587 default: return common_tag_info_func(tag); \
86- } \
87- }
88+ }} \
89+ }}
8890
8991#define MESSAGE_GROUP_INFO_FUNC GROUP_INFO_FUNC
9092
9193#define END_MESSAGE_GROUP_INFO \
9294 default: return common_group_info_func(tag); \
93- } \
94- }
95+ }} \
96+ }}
9597
9698#define MESSAGE_GROUP_INFO_STRUCT(name, node_size) \
9799static const fix_message_info \
98- name ## _message_info = { { (node_size), 0, name ## _tag_info_func, name ## _group_info_func }, name };
100+ name ## _message_info = {{ {{ (node_size), 0, name ## _tag_info_func, name ## _group_info_func }} , name } };
99101
100102#define EMPTY_MESSAGE_GROUP_INFO(name, node_size) \
101103static const fix_message_info \
102- name ## _message_info = { { (node_size), 0, name ## _tag_info_func, common_group_info_func }, name };
104+ name ## _message_info = {{ {{ (node_size), 0, name ## _tag_info_func, common_group_info_func }} , name } };
103105
104106// parser table ----------------------------------------------------------------------------------
105107#define RETURN_MESSAGE(name) \
106108 return &name ## _message_info
107109
108110#define RETURN_MESSAGE_OR_NULL(name) \
109111 return *s == SOH ? &name ## _message_info : NULL
112+
113+ // empty group info function --------------------------------------------------------------------
114+ static
115+ const fix_group_info* empty_group_info_func(const unsigned tag __attribute__((__unused__)))
116+ {{
117+ return NULL;
118+ }}
119+
120+ // groups ----------------------------------------------------------------------------------------
121+ {groups}
122+
123+ {common}
124+
125+ // messages --------------------------------------------------------------------------------------
126+ {messages}
127+
128+ // parser table ----------------------------------------------------------------------------------
129+ static
130+ const fix_message_info* {prefix}_parser_table(const fix_string msg_type)
131+ {{
132+ const char* s = msg_type.begin;
133+
134+ {parser_table}
135+ }}
136+
137+ // parser constructor ----------------------------------------------------------------------------
138+ fix_parser* create_{prefix}_parser()
139+ {{
140+ return create_fix_parser({prefix}_parser_table, CONST_LIT("{fix_version}"));
141+ }}
0 commit comments