|
|
@ -0,0 +1,19 @@ |
|
|
|
size_t <%= @name %>_position() { |
|
|
|
return <%= @name %>_end_position()); |
|
|
|
} |
|
|
|
|
|
|
|
size_t <%= @name %>_end_position() { |
|
|
|
return <%= @name %>_position()+sizeof(<%= @out_type %>); |
|
|
|
} |
|
|
|
|
|
|
|
<%= @out_type %> get_<%= @name %>(const <%= class_name %>& alter) { |
|
|
|
auto ptr = (char*)&alter; |
|
|
|
ptr+=<%= @name %>_position(); |
|
|
|
return *(<%= @out_type %>*)ptr; |
|
|
|
} |
|
|
|
|
|
|
|
void set_<%= @name %>(<%= class_name %>& alter, const <%= @out_type %>& param) { |
|
|
|
auto ptr = (char*)&alter; |
|
|
|
ptr+=<%= @name %>_position(); |
|
|
|
*(<%= @out_type %>*)ptr = param; |
|
|
|
} |