aboutsummaryrefslogtreecommitdiff
path: root/articles/2013-11-03_mapping_binary_structures_as_tuples_using_template_metaprogramming.md
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-09-11 00:47:56 +0200
committerAdrian Kummerlaender2014-09-11 00:47:56 +0200
commit63d9db8438ed6b32c4a85d487c07ea31bda666e4 (patch)
treea1296a4a262b66e7c4f19ecd124f07af1c7868c5 /articles/2013-11-03_mapping_binary_structures_as_tuples_using_template_metaprogramming.md
parent65cee5bbe39ffc2d34f44eae9207b02c58ecfbf1 (diff)
downloadblog_content-63d9db8438ed6b32c4a85d487c07ea31bda666e4.tar
blog_content-63d9db8438ed6b32c4a85d487c07ea31bda666e4.tar.gz
blog_content-63d9db8438ed6b32c4a85d487c07ea31bda666e4.tar.bz2
blog_content-63d9db8438ed6b32c4a85d487c07ea31bda666e4.tar.lz
blog_content-63d9db8438ed6b32c4a85d487c07ea31bda666e4.tar.xz
blog_content-63d9db8438ed6b32c4a85d487c07ea31bda666e4.tar.zst
blog_content-63d9db8438ed6b32c4a85d487c07ea31bda666e4.zip
Expanded formatter embellishment templates
* XHTML elements "h2" and "h3" are replaced with "h3" and "h4" respectively ** modified all existing contents accordingly ** this was done to avoid the gap between the primary heading and subheadings in the markdown depiction of the contents * fleshed out the InputXSLT project page with further information
Diffstat (limited to 'articles/2013-11-03_mapping_binary_structures_as_tuples_using_template_metaprogramming.md')
-rw-r--r--articles/2013-11-03_mapping_binary_structures_as_tuples_using_template_metaprogramming.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/articles/2013-11-03_mapping_binary_structures_as_tuples_using_template_metaprogramming.md b/articles/2013-11-03_mapping_binary_structures_as_tuples_using_template_metaprogramming.md
index a3af421..4d1aaa2 100644
--- a/articles/2013-11-03_mapping_binary_structures_as_tuples_using_template_metaprogramming.md
+++ b/articles/2013-11-03_mapping_binary_structures_as_tuples_using_template_metaprogramming.md
@@ -12,7 +12,7 @@ For the purpose of this article I am going to limit myself to flat structures wi
write mappings like [EdgeId](https://github.com/KnairdA/GraphStorage/blob/master/src/storage/id/edge_id.cc) in a more compact and efficient way. This also includes support for handling
differences in endianness and In-place modification of the structure fields.
-### Mapping buffers as tuples
+## Mapping buffers as tuples
To be able to easily work with structure definitions using template metaprogramming I am relying on the standard libraries [_std::tuple_](http://en.cppreference.com/w/cpp/utility/tuple)
template.
@@ -123,7 +123,7 @@ std::cout << mapping.get<1>() << std::endl;
~~~
{: .language-cpp}
-### Endianness
+## Endianness
As you may remember this does not take endianness into account as I defined as a requirement in the beginning. I first thought about including support for different endianness types into the
_BinaryMapping_ template class which worked, but led to problems as soon as I mixed calls to _get_ and _set_. The resulting problems could of course have been fixed but this would probably
@@ -212,7 +212,7 @@ It should be evident that the way both the _serialize_ and _deserialize_ templat
is that no actual _std::tuple_ instantiation instance is touched and instead of setting pointers to the buffer we are only reordering the bytes of each section of the buffer corresponding to
a tuple element. This results in a complete In-place conversion between different byte orderings using the methods provided by a _ByteSorter_ template such as _BigEndianSorter_.
-### Conclusion
+## Conclusion
At last I am now able to do everything I planned in the beginning in a very compact way using the _Serializer_, _TupleReader_ and _BinaryMapping_ templates. In practice this now looks like this: