1
1

Compare commits

...

252 Commits

Author SHA1 Message Date
973bd8c480 adaptive_cloth: AdaptiveMesh: use params for collapsible test
Use the `aspect_ratio_min` available in the params for the edge
collapsible test instead of the hard coded value.
2021-09-06 00:40:19 +05:30
6748f5cfbb adaptive_cloth: face sizing: change_in_vertex_normal_max as a param
Create GUI and use `change_in_vertex_normal_max` for dynamic face
sizing calculation instead of the hard coded value.
2021-09-06 00:26:41 +05:30
e07f8a6214 adaptive_cloth: AdaptiveMesh: face sizing: use params
Use values from given params instead of the hard coded parameter
values.
2021-09-05 21:55:48 +05:30
dcbd6f4257 adaptive_cloth: gui for edge_length_max and aspect_ratio_min 2021-09-05 21:47:00 +05:30
7a0683cf05 adaptive_cloth: parameter name from size_min to edge_length_min 2021-09-05 20:35:07 +05:30
fd9b3419ea adaptive_cloth: AdaptiveMesh: dynamic face sizing (for curvature)
Compute the dynamic face sizing with respect to curvature and do eigen
decomposition of the final sizing to add constraints with respect to
edge lengths and aspect ratio.
2021-09-05 11:05:24 +05:30
9d32df72b4 adaptive_cloth: AdaptiveMesh: calculate derivative
Calculate derivative of the given float3s with respect to the uv space
coordinates of the given face.
2021-09-05 11:04:23 +05:30
030e53da23 adaptive_cloth: Mesh: Node: get normal 2021-09-05 11:03:36 +05:30
6c5a5cb83d float2x3 and float3x2: transpose and multiplication with intern file
Transpose and multiplication requires access to the other structure as
well, this cannot be done through header files only, at least not
easily. So separate implementation files for each with the respective
functions that are required.
2021-09-05 11:01:44 +05:30
c5433fdcb2 float3x2: constructor through columns of the matrix 2021-09-05 10:56:14 +05:30
4b8dc73996 float2x2: transpose 2021-09-05 10:55:47 +05:30
04496a2e01 float2x2: inverse 2021-09-05 10:55:38 +05:30
653da43627 float2x2: constructor through direct values of the matrix 2021-09-05 10:55:22 +05:30
672e4c3fa5 float2x2: constructor through columns of the matrix 2021-09-05 10:54:59 +05:30
b37ecf5855 float2x2: eigen decomposition 2021-09-04 20:19:57 +05:30
0514f64a0f adaptive_cloth: AdaptiveMesh: dynamic: vert sizing from face sizing
Calculate the vert sizing by taking the uv area weighted average of
the sizing of the adjacent faces of the vert.
2021-09-02 20:55:41 +05:30
c5461f624e adaptive_cloth: AdaptiveMesh: dynamic: vert sizing calc overview 2021-09-02 20:07:36 +05:30
189c38dced adaptive_cloth: AdaptiveMesh: set uv area for faces 2021-09-02 20:07:25 +05:30
b04ba2e8eb adaptive_cloth: AdaptiveMesh: FaceData: initial, store uv area 2021-09-02 20:06:30 +05:30
48278754a7 adaptive_cloth: Add dynamic remeshing selection to GUI
Add remeshing type support to both the cloth modifier and the adaptive
remesh modifier.

The basic call for dynamic remesh is also setup, only need to work on
finding the vertex sizing dynamically.
2021-09-02 14:43:54 +05:30
ffcc059abf adaptive_cloth: fix: Mesh: collapse edge: n2 not updated for v1
A simple solution that is extremely difficult to debug. This
particular part of the collapse edge function is run rarely and to
make this particular bug even harder to find is that only a subsequent
operation will show any signs of a problem.

One way to trigger this bug is to static remesh Suzanne (Blender
monkey) at 0.005 or lower minimum size. This leads to a crash due to a
bad optional access of a node.

The vert refers to the node but the node doesn't refer to the vert. So
once this sort of situation is created, when that vert's nodes need to
be used, it leads to a bad optional access.

Such a simple fix :)
2021-09-01 20:31:07 +05:30
a5c01917e8 adaptive_cloth: squash unused parameters warnings in release mode
All unused parameter warnings in BKE_cloth_remesh.hh and
cloth_remesh.cc have been fixed either by adding a #ifndef NDEBUG
directive or by changing the code slightly.
2021-09-01 14:56:17 +05:30
5bdf40dcda adaptive_cloth: AdaptiveMesh: verts of new sewing edge as preserve
Newly created sewing edges's verts should also be marked as preserve.
2021-09-01 13:50:49 +05:30
940ee5d587 adaptive_cloth: AdaptiveMesh: force split for sewing
Option to split the opposite edge even if it does not meet the size
criterion, with the option, it ensures that no sewing edge is missed
when an edge is split (it can be missed if the opposite edge doesn't
meet the size criterion).
2021-08-31 21:17:59 +05:30
9635768cda adaptive_cloth: AdaptiveMesh: mark sewing edge verts as preserve
Mark all verts attached to sewing edge(s) as preserve, this ensures
that no sewing edge(s) are removed which would otherwise lead to
results are not in line with what the artist would want.
2021-08-31 20:32:55 +05:30
1600f3de96 adaptive_cloth: AdaptiveMesh: ensure edge between sewing edges
While trying to create the sewing edges, ensure that the vert in
question is between 2 or more edges that are between sewing edges.

Also ensure that the opposite is between sewing edges.
2021-08-31 19:11:38 +05:30
79f70b1b09 adaptive_cloth: AdaptiveMesh: no need to add flag after split edge
Since split edge triangulate already handles copying the extra data,
there is no need to try to add the flag `EDGE_BETWEEN_SEWING_EDGES` to
the newly split edges.
2021-08-30 18:08:16 +05:30
d1b89d1a71 adaptive_cloth: Mesh: split edge: option to copy extra data
An extra option to copy to the extra data from the edge that is split
to the edges that are formed due to the split. This does not include
the other edges added for triangulation purposes.
2021-08-30 18:06:35 +05:30
28732a6ee1 adaptive_cloth: AdaptiveMesh: setting EdgeData flags after split
Edges that had EDGE_BETWEEN_SEWING_EDGES when split, the new edges
should also be EDGE_BETWEEN_SEWING_EDGES.
2021-08-29 20:22:00 +05:30
3b54908fd7 adaptive_cloth: AdaptiveMesh: mark edges between sewing edges
Add a new flag for EdgeData that stores if the edge is between sewing
edges or not.

A function that marks all the edges that between sewing edges.

Call this function in the initialization of the static remeshing if
sewing is enabled.
2021-08-29 20:19:47 +05:30
68e2240857 adaptive_cloth: AdaptiveMesh: sewing: dump file after adding edge
Dump the serialized Mesh after adding the loose (sewing) edge.
2021-08-28 17:59:33 +05:30
f2e0b6b21c adaptive_cloth: AdaptiveMesh: do not split a loose edge 2021-08-28 17:47:59 +05:30
f0721e7b16 adaptive_cloth: AdaptiveMesh: sewing: add the sewing edge if needed
If the opposite edge still exists and it can be split, add a sewing
edge between `vert` and the newly created vert.
2021-08-28 17:30:43 +05:30
8abda209a4 adaptive_cloth: AdaptiveMesh: split edge: verts added during split
Split edge now appends the flip edges mesh diff to the split edge mesh
diff and returns this complete mesh diff and the verts that were added
during split operation.
2021-08-28 17:28:36 +05:30
3192103d22 adaptive_cloth: AdaptiveMesh: flip edges: return complete MeshDiff
Return a complete MeshDiff of all the operations done in flip edges by
appending the MeshDiff(s) after each operation.
2021-08-28 16:32:02 +05:30
25cfaf2e5c adaptive_cloth: AdaptiveMesh: is edge splittable
Abstract out the edge splittablity check to a function.
2021-08-28 16:28:59 +05:30
01881edbe9 adaptive_cloth: AdaptiveMesh: compute_info_element functions
AdaptiveMesh specific compute info for elements. This internally calls
the Mesh specific compute info to make function calls easier.
2021-08-28 16:22:20 +05:30
89e7d6b02f adaptive_cloth: MeshDiff: append one MeshDiff to another 2021-08-28 16:09:23 +05:30
f1c057006b adaptive_cloth: MeshDiff: remove elements that don't exist in mesh
It is possible to create a MeshDiff which is updated to remove a
certain element that was initially added. So the added element index
is no longer valid and should be removed.

This function removes elements from the `added_elements` lists that no
longer exist in the mesh.
2021-08-28 16:07:17 +05:30
33a37c854e adaptive_cloth: MeshDiff: add elements
Functions to add elements to `added_element`.
2021-08-28 16:05:28 +05:30
c47d67260e adaptive_cloth: Mesh: add checked loose edge
Adds a loose edge to the mesh with the given vert indices and ensures
that these vert indices do not already have an edge between them and
that they exist.
2021-08-28 16:04:20 +05:30
8f283d50d7 adaptive_cloth: Mesh: compute info separate functions for each type
`compute_info()` now calls separate functions for each element type
instead of computing it within that function. This allows other parts
of the code to compute info of the element when it is easier to do
over creating a mesh diff.
2021-08-28 16:02:05 +05:30
611172fd8c adaptive_cloth: Mesh: functions to check if mesh has that element
Given the element's index, it check if the element still exists in the
mesh.
2021-08-28 16:00:33 +05:30
8e8946c545 adaptive_cloth: AdaptiveMesh: sewing edge: get set of opposite edges
Given a vertex, the function is supposed to add a sewing edge to it if
possible.

Currently the function gets the set of opposite edges. An opposite
edge is an edge that is in between 2 loose edges and these loose edges
are connected to edges that connect to the given vert.

            e1   vert   e5
    e1_ov.________.________.e4_ov
         |                 |
       e2|                 |e4
         ._________________.
    e2_ov   opposite_edge   e3_ov
                 (e3)

What needs to be done: With the set of opposite edges, if the edge is
splittable then it should be split and a new edge should be added
between vert and the newly created vert (vert created when splitting
the opposite edge).
2021-08-28 00:15:57 +05:30
7608be58f1 adaptive_cloth: Mesh: Edge: get checked other vert 2021-08-28 00:15:27 +05:30
ab857c4ce9 adaptive_cloth: fix: Mesh: split edge: elements missed in MeshDiff
Split edge function didn't add the new node and the new vert(s) to
MeshDiff.
2021-08-28 00:14:02 +05:30
ee7425dab7 adaptive_cloth: AdaptiveMesh: flag for sewing with gui where needed
Added a new flag to have sewing enabled. The flag doesn't do anything
yet (no functionality).

Added the required code to pass this sewing option to
adaptive_remesh().

Created the GUI for this flag in the AdaptiveRemesh modifier.
2021-08-28 00:14:02 +05:30
4465d236d2 float2x3: initial 2021-08-27 16:16:00 +05:30
6acfed0712 float3x2: initial 2021-08-27 15:32:21 +05:30
c4f5736275 float2x2: documentation 2021-08-27 15:32:08 +05:30
d134678da7 float4x4: documentation 2021-08-27 15:31:26 +05:30
d17b21604d adaptive_cloth: ClothNodeData: fix typo for ClothVertex flags interp 2021-08-26 10:06:00 +05:30
950857656d adaptive_cloth: ClothNodeData: interp goal correctly
The goal of the ClothVertex causes the vertex to move towards xconst
so it doesn't make sense to interpolate the goal since this will lead
to a gradient for the goal and this is not artist friendly, there
would be no way for the artist to define only a specific vertex to be
attached to a point in 3D space.
2021-08-19 18:53:36 +05:30
bf0f118419 adaptive_cloth: ClothNodeData: interp flags correctly 2021-08-19 17:32:58 +05:30
e68cf37413 cloth: fix: reset per vertex spring count when building springs
While building the structural springs, the vertices that connect the
springs, their spring count is incremented.

Since the springs are being rebuilt entirely, the spring count should
also be reset.
2021-08-19 16:58:26 +05:30
5afe71daf5 adaptive_mesh: serialize and dump the cloth mesh every frame 2021-08-19 16:24:56 +05:30
111458f6c7 adaptive_cloth: fix: Mesh: collapse edge: can lead to loose verts
The previous commit can lead to loose verts (verts that don't have any
edges attached). Such verts should be deleted.
2021-08-15 16:08:07 +05:30
53033ffd11 adaptive_cloth: fix: Mesh: collapse edge: can lead to loose edges
There are some edge cases (:P) that can lead to the creation of loose
edges when collapsing the edge.

Suppose v2 has an edge that contains only 1 face and this face also
contains v1, the face was deleted but the remaining edge between v2
and ov, remained. This causes the loose edge. The simple check and
deletion of such an edge fixes this bug.
2021-08-14 14:48:31 +05:30
e4165cdcf9 adaptive_cloth: AdaptiveMesh: fix: aspect ratio, wrong area
Must take the non directional area (absolute value of the area) since
the order of the verts of the face may not correspond to normal of the
face always. The aspect ratio calculation should not be doing the
inversion testing as well. (This could be used for inversion testing
but without proper math backing it, don't want to use it right now).
2021-08-13 19:39:58 +05:30
161fa5b4da adaptive_cloth: AdaptiveMesh: aspect ratio test when collapsing edge
Test to see if the faces generated when collapsing the edge will not
meet the aspect ratio criterion.

There is a lot more information about which algorithm is used for
calculating the aspect ratio in the code comments. A gist of it would
be that there many different ways to calculate the aspect ratio of a
triangle and each provides a different end result suitable for
different needs. This makes it hard to select the right algorithm.
2021-08-13 14:35:38 +05:30
1a1185b599 adaptive_cloth: cloth: prev_frame_mesh is invalid if frame incorrect
When current frame (framenr) is not immediately following the
last_frame stored, the `prev_frame_mesh` is invalid and must be
deleted. When remesh is on, even the clothObject is invalid, so delete
that as well.
2021-08-12 22:28:14 +05:30
72d10c1edc adaptive_cloth: Store previous frame mesh information for remeshing
The modifier stack doesn't give the previously evaluated `Mesh`, this
means it needs to be stored within the `ClothModifierData`.

Some parts of the cloth modifier copy information from the given
`Mesh` to the `clothObject` every frame, this should not happen when
remeshing is on.

In `BKE_cloth_remesh()`, must use the previous frame mesh if available
for remeshing.

TODO: In case the user goes back a frame, must make the
`clmd->prev_frame_mesh` invalid otherwise the simulation will not know
that the simulation must be restart.
2021-08-12 20:21:08 +05:30
bd0a9f1943 adaptive_cloth: Mesh: msgpack: store the type of Mesh on first line
This allows the code that deserializes it to decide which type of Mesh
structure to deserialize to. Since msgpack is compact, it doesn't
store information about the size (explicitly or implicitly) of the
element, this means that deserialization can lead to weird outputs if
wrong data structures are used.
2021-08-12 13:25:37 +05:30
aa7fceb7a1 adaptive_cloth: set cloth information after remeshing
The cloth object doesn't know about the updated mesh, so update the
entire cloth object to utilize the new mesh.
2021-08-12 11:48:26 +05:30
0cbad198c7 adaptive_cloth: AdaptiveMesh: more info in file dump filename
Store the edge index as well.
2021-08-12 00:05:17 +05:30
ba82bc87aa adaptive_cloth: AdaptiveMesh: collapse edge: face inversion test
An edge is collapsible only if it doesn't invert any faces.
2021-08-11 12:35:02 +05:30
bb31b5bca0 adaptive_cloth: Mesh: get vert indices of edge aligned with n1
A set of "3D edges" don't always have n1 and n2 (through the verts of
the edge) in the same order, useful to get it in the same order.
2021-08-11 11:50:18 +05:30
b3d8a748a3 adaptive_cloth: AdaptiveMesh: call compute_info() where needed 2021-08-11 00:06:56 +05:30
f9c2f52517 adaptive_cloth: AdaptiveMesh: compute info for newly added elements
AdaptiveMesh needs some more calculations, like edge size.
2021-08-11 00:06:07 +05:30
1717a4d55c adaptive_cloth: Mesh: compute info for newly added elements
Using MeshDiff which provides the newly added elements, iterate over
these elements and calculate certain required information. This makes
it easier to take care of things. If there is a MeshDiff produced,
always call compute_info() with it. This ensures all required
information is always available.
2021-08-11 00:05:50 +05:30
31d2283c3c adaptive_cloth: AdaptiveMesh: no edge flip if inverted face normals
Edge flippability test should prevent flipping of an edge that will
lead to inverted face normals.
2021-08-10 22:12:33 +05:30
1501a34915 adaptive_cloth: remesh: compute face normals after creating mesh 2021-08-10 22:08:52 +05:30
99b9417f42 adaptive_cloth: Mesh: compute face normal(s) 2021-08-10 22:08:44 +05:30
be8d07b349 adaptive_cloth: AdaptiveMesh: preserve vert
Need to mark verts that should be preserves, ones that are on seams or
boundaries at the beginning of the remeshing process so that the
initial state is not altered.

Collapse edges should not collapse a vert that should be preserved
into another vert.
2021-08-09 16:36:57 +05:30
3aca3d8ad3 adaptive_cloth: FilenameGen: increase number of leading zeros
Now that many more operations take place during remeshing, it exceeds
1000, so need to update the number of leading zeros.
2021-08-09 16:36:07 +05:30
e57f77f6bf adaptive_cloth: AdaptiveMesh: collapse edges: edge size criterion
If the edge were to be collapsed, the newly formed edges shouldn't
exceed the edge size criterion (1.0 - small_value).
2021-08-08 19:07:26 +05:30
c73bc92e06 adaptive_cloth: AdaptiveMesh: collapse edges: run flip edges
It is important that the total update to faces of the mesh (collapse
followed by flip edges) is added to the new_active_faces.
2021-08-08 18:28:04 +05:30
7519d40091 adaptive_cloth: AdaptiveMesh: collapse edges: initial steps
There are todos but the code roughly works.
2021-08-08 18:09:22 +05:30
ba26266997 adaptive_cloth: mesh: is vert on seam or boundary 2021-08-08 18:08:44 +05:30
2f60cb83c5 adaptive_cloth: mesh: is edge collapseable: make function const 2021-08-08 18:07:42 +05:30
b19335d5f3 adaptive_cloth: mesh: const version of get checked node of vert 2021-08-08 18:07:06 +05:30
c7a231c75d adaptive_cloth: AdaptiveMesh: flippability: consider abs of 2 terms
Consider the absolute value of the cross_2d values generated because
they are just calculating the area and the assumption is that the
orientation of the triangles shouldn't matter for this test.
2021-08-07 12:01:23 +05:30
78c1afa8fd adaptive_cloth: should remesh dump file macro
This helps turn off dumping of the serialized mesh easily.
2021-08-07 11:33:45 +05:30
9de42e7030 adaptive_cloth: mesh: split edge: correct orientation for new face
Set the correct orientation for the new faces formed during the split
edge operation.

By swapping the unwanted vert for the new vert, the orientation is
preserved.
2021-08-06 18:51:13 +05:30
fb67bf4941 adaptive_cloth: AdaptiveMesh: edge flip test: only if edge size is ok
Allow the edge flip only if the flipped edges doesn't exceed the edge
size requirement.
2021-08-06 16:42:52 +05:30
5bef741e58 adaptive_cloth: Mesh: edge flippable: no connecting edge ov1, ov2
Ensure that the edge when flipped does not already have a connecting
edge. This leads to a variety of problems like overlapping duplicate
faces or deletion of faces if no duplication is a requirement. Edge
flips should only change the orientation of the edge which is only
through connectivity change, not actually change the number of
edges/faces.
2021-08-06 11:13:01 +05:30
acaf87d88c adaptive_cloth: AdaptiveMesh: flip edges: set edge size
It is important to set the edge size for all the newly created edges.

Limit the number of loops, it can easily become an infinite
loop. There should be a better solution for this but cannot think of
one as of right now.

Always check if the edge is still flippable or not. Again, this
couldn't be solved with a different flip edge algorithm where the new
edge is always added, but right now, that isn't possible.
2021-08-06 10:35:20 +05:30
e3947dfd10 adaptive_cloth: AdaptiveMesh: splittable edges indices set changes
Earlier, an edge wouldn't be tested for if one of it's verts was
already selected (for another edge). This would seems almost correct
but leads to non symmetrical remeshing. So it makes sense to get all
the splittable edges, sort them based on their size and then split the
edge only if it still exists in the mesh.

So changes added:
Give the entire set of splittable edges instead of maximally
independent.
Sort the set based on the edge size.
2021-08-05 15:09:00 +05:30
84562e2eac adaptive_cloth: fix: AdaptiveMesh: anisotropic flip check
Based on the next paper by the same authors, "Folding and Crumpling
Adaptive Sheets". The edge flip criterion is different. So using this
now.
2021-08-05 14:05:28 +05:30
4e2a10352d adaptive_cloth: fix: mesh: flip edge: edge might already exist
It is possible that there might already be an edge between ov1 and ov2
so it is best to not create a new edge between those because edges
between verts should always be unique for all the algorithms to work
correctly.

It is a case that shouldn't show up too often but when it does, it
will be interesting to see what happens in the static remeshing
part. The number of faces remains the same but number of edges can
change (reduce only).
2021-08-05 11:14:30 +05:30
cb9424b99c modifier: adaptive_remesh: collapse edge only if collapseable 2021-08-04 12:29:19 +05:30
44c82975ec adaptive_cloth: mesh: collapse edges: remove dump file statements 2021-08-04 12:28:25 +05:30
cae9f4dd95 adaptive_cloth: mesh: is_edge_collapseable()
The collapse edge operation doesn't support one type of edge
collapse. When the collapse is across seams, it is possible for one
vert v1 to be asked to collapsed into multiple verts v2. Now deciding
which v2 to consider is a difficult task, so not handling it right now.
2021-08-04 11:27:33 +05:30
fdda6f3f63 adaptive_cloth: mesh: collapse edge: tackle edge case
During an across seams collapse edge, it is possible that n1 might
still have v1 attached to it. Take the example of a icosphere's bottom
most vert collapsed into some other neighbouring vert.

For this, make v1.node point to n1 so essentially, v1 has been
converted to v2 instead of removing it.
2021-08-04 10:42:32 +05:30
29c73ddd2e adaptive_cloth: mesh: face edge linkage checks improvement
It is not necessary for the face to have it's verts available, because
delete_edge() can remove the verts from the face. So this check
ensures that there is no out of bounds access.
2021-08-04 10:16:41 +05:30
dc1144f59f adaptive_cloth: mesh: collapse edge across seams
It works for most cases. There is one case that is difficult to do
for, when v1 has two v2 to collapse into. Will add a check to make
sure the edge is collapsed only if collapse-able.
2021-08-04 09:31:57 +05:30
bffe7c58d9 adaptive_cloth: mesh: collapse edge rewrite to fix bugs
Found a lot of bugs in collapse edge routine using the debug
tool so needed a rewrite of this function.

Need to still add across seams support.
2021-08-03 22:15:59 +05:30
20d24a9995 adaptive_cloth: msgpack: store more information for easier debugging
Ideally this wouldn't be needed. This makes it easier to debug the
deserialization part. In case msgpack is used for final caching this
information needs to be removed.
2021-08-02 11:15:26 +05:30
764ddf1d8f adaptive_cloth: static_remesh: dump file after each split and flip 2021-08-01 22:43:58 +05:30
dd364de831 adaptive_cloth: filename_gen: number has 0's to make length 3 2021-08-01 22:42:59 +05:30
094e0e740c modifier: adaptive_remesh: filename has edge_i with 0s 2021-08-01 18:50:47 +05:30
4e154c59a2 modifier: adaptive_remesh: dump file pre and post edge operation 2021-08-01 11:35:34 +05:30
d1c296519c adaptive_cloth: serialize Mesh and store to /tmp/test.msgpack 2021-07-27 14:59:21 +05:30
0772a217b9 msgpack: adaptive_cloth: Mesh: packer implementation 2021-07-26 23:59:21 +05:30
c90331221c msgpack: adaptive_cloth: Mesh Elements: packer implementation 2021-07-26 23:58:54 +05:30
b04f0c47e1 msgpack: adaptive_cloth: internal: packer implementation 2021-07-26 23:57:59 +05:30
3170667177 msgpack: blender::generational_arena::Index: packer implementation 2021-07-26 23:57:08 +05:30
6852a81516 msgpack: blender::Map<Key, Value>: packer implementation 2021-07-26 23:56:44 +05:30
0d68431f94 msgpack: blender::float3: packer implementation 2021-07-26 23:56:31 +05:30
609435bcff msgpack: blender::float2: packer implementation 2021-07-26 23:55:59 +05:30
f0f29153d2 msgpack: blender::generational_arena::Arena: packer implementation 2021-07-26 18:10:14 +05:30
a4350ffaec msgpack: blender::Vector<T>: packer implementation
Implement msgpack's packer for blender::Vector<T>.
2021-07-26 17:54:39 +05:30
c277047cb3 extern: msgpack: add this header only library
This will allow serialization of the adaptive cloth mesh structure
more easily.

From the website: https://msgpack.org
MessagePack is an efficient binary serialization format. It lets you
exchange data among multiple languages like JSON. But it's faster and
smaller. Small integers are encoded into a single byte, and typical
short strings require only one extra byte in addition to the strings
themselves.
2021-07-26 16:49:06 +05:30
1479175a9a adaptive_cloth: AdaptiveMesh: split_edges: run flip_edges()
On the faces that were added by the split edge operation, run the
flip_edges() function.
2021-07-22 17:41:29 +05:30
11ceeef00c adaptive_cloth: AdaptiveMesh: flip_edges()
Flips edges of the `active_faces` if needed.

* Get the maximally independent set of flippable `AdaptiveEdge`s.
* Flip each edge in this set and update `active_faces` with the faces
affected by this operation.
* Repeat until the set has 0 flippable `AdaptiveEdge`s
2021-07-22 17:39:03 +05:30
f81d1d4ad6 adaptive_cloth: AdaptiveMesh: get_flippable_edge_indices_set()
Similar to get_splittable_edge_indices_set() it checks for
flippability of the `AdaptiveEdge` instead of the "size" of the
`AdaptiveEdge`.
2021-07-22 17:37:31 +05:30
dcb069ed25 adaptive_cloth: AdaptiveMesh: is_edge_flippable_anisotropic_aware()
Function to check if the given `Edge` is flippable or not by adding an
anisotropic aware check.

Based on reference [1].
2021-07-22 17:36:56 +05:30
bec5b06b55 adaptive_cloth: AdaptiveMesh: VertFlags: VERT_SELECTED_FOR_SPLIT
rename `VERT_SELECTED` to `VERT_SELECTED_FOR_SPLIT` for more explicit
meaning
2021-07-22 17:31:37 +05:30
249115583c adaptive_cloth: AdaptiveMesh: Sizing: overload add and mul ops
Overload the operators to allow operations on `Sizing` itself. This
will help in case `Sizing` will need to change in the future maybe for
adaptive tearing support.
2021-07-22 17:27:11 +05:30
d71ee2d5e3 adaptive_cloth: Mesh: does_element_exist()
Set of functions to test if the element still exists in the `Mesh`
when given it's index.
2021-07-22 17:26:26 +05:30
1ab96c45a0 adaptive_cloth: Mesh: checked and unchecked get_other_vert_index()
`get_checked_other_vert_index()` a new checked version of
`get_other_vert_index()`

Update `get_other_vert_index()` to have better checks
2021-07-22 17:25:06 +05:30
612ebd73f9 adaptive_cloth: Mesh: Edge: get_checked_verts() 2021-07-22 17:24:33 +05:30
059fe4ff63 adaptive_cloth: Mesh: make get_edge_indices_of_face() as protected 2021-07-22 17:23:00 +05:30
151a8a3894 adaptive_cloth: Mesh: is_edge_loose_or_on_seam_or_boundary() 2021-07-22 11:39:13 +05:30
87e3b5a52b adaptive_cloth: Mesh: is_edge_on_seam() 2021-07-22 11:38:45 +05:30
d2f7b1a1e8 adaptive_cloth: Mesh: is_edge_loose() 2021-07-22 11:38:26 +05:30
358030554a modifier: adaptive_remesh: UI for static remeshing of the mesh
Simple UI to allow `adaptive_remesh()` through the simple wrapper to
be called and controlled easily.

This should help with testing since the cloth simulator when applied
uses the (point) cached `Mesh` instead running the simulation which
will call `adaptive_remesh()` for us. This will need to be fixed later
but this is an easier approach to continue development the adaptive
remesher.
2021-07-21 23:27:17 +05:30
b5f262b3e0 adaptive_cloth: adaptive_remesh: create an "Empty" remesh function
It is useful to call `adaptive_remesh()` outside of the cloth
simulator mainly for testing purposes. Now because the use of
templates for the function `adaptive_remesh()` and it being defined
not in the same header file (this isn't possible in this case because
of other reasons), it requires a template instantiation needs to
happen because the function is called or something like that. This
leads to problems when `adaptive_remesh()` is called from some other
file.

The easiest fix was to create a new wrapper function without templates
and call this from other files.
2021-07-21 23:23:22 +05:30
c080ca1b37 modifier: adaptive_remesh: use dna defaults through initData
Adding defaults for a new modifier is not as simple as just adding the
new structure to the defaults macro file. It needs to be copied over
to the ModifierData to actually use it.
2021-07-21 23:19:59 +05:30
1780f2aaf8 adaptive_cloth: create an abstraction for adaptive_remesh
The adaptive remeshing algorithm is not dependent on the cloth
modifier so it makes sense to abstract at least to a point of not
needing all of the `ClothVertex` data.

This will help with testing of the implementation by adding it to the
`AdaptiveRemesh` modifier.
2021-07-21 21:55:59 +05:30
5567ceea92 adaptive_cloth: AdaptiveMesh: set edge size after splitting edge
Need to set the edge size for all edges effected by the split operation.
2021-07-21 18:30:21 +05:30
642288268c adaptive_cloth: MeshDiff: operator<< for ostream 2021-07-21 18:18:17 +05:30
fbef3efcf9 adaptive_cloth: fix: Mesh: split edge: edge vert references fault
References between the `Edge`s and `Vert`s were not created.
2021-07-21 17:51:06 +05:30
1549da9678 adaptive_cloth: Add UI for size_min of static_remesh 2021-07-19 22:25:09 +05:30
6f39ef31ea adaptive_cloth: implement and run static_remesh()
Sets the same "sizing" for all the `Vert`s of the `AdaptiveMesh` and
then runs `mesh.split_edges()`.

TODO(ish): Add mesh.collapse_edges() within static_remesh()
2021-07-19 22:05:53 +05:30
d7531b6a9a adaptive_cloth: AdaptiveMesh: split_edges()
Splits edges whose "size" is greater than 1.0

TODO(ish): Need to flip edges of those faces that have been affected
by the split edge operation.
2021-07-19 22:05:23 +05:30
c4a08df49e adaptive_cloth: AdaptiveMesh: get_splittable_edge_indices_set()
Gets the maximal independent set of splittable edge indices in the
`AdaptiveMesh`.
2021-07-19 22:01:38 +05:30
790f69d122 adaptive_cloth: AdaptiveMesh: VertData: add flag
Add flag to be able to tag the `Vert`.
2021-07-19 22:00:19 +05:30
8801d58ce8 adaptive_cloth: AdaptiveMesh: extra data interp
Add interp() function to the extra data of `AdaptiveMesh`
2021-07-19 21:59:13 +05:30
4d3cfce00f bli: float2x2: linear_blend()
Linearly blend between the 2 matrices.
2021-07-19 21:55:32 +05:30
460fea65ad adaptive_cloth: Mesh elements: get_self_index() 2021-07-19 21:55:00 +05:30
a21cb0b63a adaptive_cloth: AdaptiveMesh: set_edge_sizes()
Based on the `Sizing` stored in the `Vert`s of the `Edge`s, store the
"size" of the `Edge` in it's extra data.
2021-07-18 21:39:25 +05:30
1bfedda596 adaptive_cloth: Mesh: change visibility of many utility functions
Make them protected instead of private.

Functions that get some element from the `Mesh` (maybe through other
elements) can be used by derived classes. It might make sense to make
these functions public directly instead of protected but will take
that decision later.
2021-07-18 21:34:01 +05:30
3ccc9cdbd4 adaptive_cloth: Vert: get_uv() and get_uv_mut() 2021-07-18 21:32:45 +05:30
d2244cb40b adaptive_cloth: Mesh: get extra data from elements
Simple functions to get extra data from elements.
It is possible make `extra_data` public but this reduces readability
of the code. By having these functions, intent is obvious.
2021-07-18 21:29:30 +05:30
79a90776d2 adaptive_cloth: AdaptiveMesh: set and retrieve Nodes extra data
From the `Cloth::verts`, set the extra data in the `Mesh::nodes`.

Delete the `Cloth::verts` to not have duplicate data.

Allocate data for `Cloth::verts`, and set from the `Mesh::nodes`.
2021-07-16 23:40:47 +05:30
fee8367e4a adaptive_cloth: Mesh: get elements mutably
Useful to get the elements mutably.

This does make `Mesh` less "safe" since anyone can add or delete
elements without creating/deleting the necessary referencing between
the elements but this shouldn't be too much of a problem because it
would lead to an instant forced crash when the `Mesh` is used for
anything.
2021-07-16 23:30:34 +05:30
d6b35a45a9 adaptive_cloth: BKE_cloth_remesh: convert to and from AdaptiveMesh 2021-07-16 22:14:05 +05:30
2c6d3ab678 adaptive_cloth: Sizing: get edge size squared 2021-07-16 22:06:11 +05:30
57e374f089 adaptive_cloth: VertData: initial implementation
Used to store extra `Vert` data in the `Mesh`.
2021-07-16 22:02:04 +05:30
4b94a2be22 adaptive_cloth: NodeData: initial implementation
Used to store extra `Node` data in the `Mesh`.
2021-07-16 21:56:41 +05:30
04cec203e3 adaptive_cloth: BKE_cloth_remesh() add to namespace blender::bke 2021-07-16 21:54:44 +05:30
b34235a2eb bli: float2x2: multiply matrix with float 2021-07-16 20:52:23 +05:30
c07dad40c9 bli: float2x2: add 2 matrices 2021-07-16 20:52:03 +05:30
581d46112a bli: float2x2: initial implementation 2021-07-16 14:58:50 +05:30
18e84a915a adaptive_cloth: Mesh: collapse edge: all v1 should point to n1
Sometimes, `n1` will have still have verts attached to it, so it makes
sense to make those verts point to `n2` but keep their UV coordinates
since attempting to merge verts not joined by edges can lead to lot of
issues. So essentially, extra `v1`s becomes `v2`s.
2021-07-15 11:31:18 +05:30
a027f4ea4b adaptive_cloth: fix: Mesh: split edge: reference is broken
The reference to the edge is broken because adding or deleting an edge
can realloc memory which means all the references are invalid. So just
need to recreate the references after a addition or deletion of an
element.

Would really appreciate a borrow checker to handle such
instances.
2021-07-15 09:38:45 +05:30
a1a8608fce adaptive_cloth: Mesh: flip_edge: do operation by deleting and adding
Sometimes, the user needs to know which elements have been affected,
for this, delete and add new elements. This shouldn't have any effect
on performance in theory because the arena should add back the
elements in the place where it has been deleted, hasn't been tested.
2021-07-14 18:09:53 +05:30
1b5a2cf325 adaptive_cloth: Mesh: is_edge_flippable(): works with across_seams
It is useful to know if the "3D edge" is flippable or not. This is
essentially done by going over all the `Edge` formed by the `Node`s of
the `Edge` and working with all those faces as a whole. Here we also
need to ensure that the edge is not on a seam. It actually might be
possible to optimize this and remove the boundary check entirely.
2021-07-14 13:03:12 +05:30
2f8a2fad29 adaptive_cloth: Mesh: is_edge_on_boundary()
Checks if the given edge lies on the boundary of the mesh.
2021-07-14 12:30:42 +05:30
79cad4c0b6 adaptive_cloth: Mesh: flip_edge_triangulate() initial implementation
Need to implement across seams support.
2021-07-14 10:46:35 +05:30
5bb6a05d7a adaptive_cloth: Mesh: collapse_edge_triangulate(): across_seams option 2021-07-13 18:49:46 +05:30
0913090091 adaptive_cloth: fix: Mesh: collapse_edge_triangulate(): delete node only if no other vert refers to it 2021-07-13 11:55:26 +05:30
c5ed6fab1f adaptive_cloth: fix: Mesh: collapse_edge_triangulate() invalid faces generated
The edge between v1 and ov should be removed only if the edge doesn't have any linked faces. If it has any linked faces, it will make those faces invalid and cause problems down the line. For the face to have (v2, ov, vx), this becomes impossible since (v1, ov) has been removed, this is wrong.
2021-07-13 10:36:06 +05:30
84a0df0776 adaptive_cloth: Mesh: collapse_edge_triangulate() version 2 2021-07-12 19:17:41 +05:30
316ddc19e2 adaptive_cloth: fix: Mesh: split_edge_triangulate() crash when edges are realloced
Took the new edge index by reference instead of copy leading to wrong memory access when the edges are reallocated by the arena.
2021-07-11 22:21:11 +05:30
ac431c17f4 adaptive_cloth: Mesh: make split_edge_triangulate() work with new deletion methods 2021-07-11 18:05:59 +05:30
f1f9559345 adaptive_cloth: Mesh: delink face edges 2021-07-11 18:05:31 +05:30
eb010b33a2 adaptive_cloth: Mesh: const get checked elements 2021-07-11 18:03:09 +05:30
02fab35860 adaptive_cloth: Mesh: better deletion of the elements
This new way of deleting elements ensures that no links can be missed out on. The deletion of the elements has to happen in a certain order leading to lesser number of errors.

This is API breaking, so all functions refering to deletion of the elements have to be updated. This includes, Mesh::split_edge_triangulate() and Mesh::collapse_edge_triangulate().
2021-07-11 13:32:10 +05:30
71c8a2d6bc modifier: adaptive_remesh: select split or collapse edge operation 2021-07-10 17:15:57 +05:30
740f622a03 adaptive_cloth: Mesh: collapse_edge_triangulate() first draft 2021-07-10 17:13:47 +05:30
4d7b919703 adaptive_cloth: Mesh: write to MeshIO: allow gaps in the Arena(s)
There can be gaps in the `Arena`s introduced due to removing elements in the middle of the `Arena`. Now this can lead to wrong indexing when writing the positions and the uvs. For this, create a `Map` between the element's arena index and it's true index in the vectors created for them.
2021-07-09 11:28:42 +05:30
a33623b553 adaptive_cloth: Mesh: split_edge_triangulate(): support for across seams
In the `Mesh` structure, `Edge` stores a tuple of `Vert`s which means,
it is based on the UV coordinates, although this is quite useful,
sometimes it is important to have the mesh operation happen across the
UV seams as well. So consider all the edges formed by the `Vert`s
stored in the `Node` of the given `Edge`'s `Vert`s. Confusing, yes,
but simple.
2021-07-08 23:48:15 +05:30
daec1377a9 adaptive_cloth: Mesh: append non duplicate vert indices in node.verts 2021-07-08 18:25:13 +05:30
0bf9f99834 adaptive_cloth: Mesh: split edge: remove completed todo comment 2021-07-08 17:47:57 +05:30
ef439454c7 adaptive_cloth: fix: Mesh: delete_face(): wrong starting index 2021-07-08 13:01:23 +05:30
8ceb995670 adaptive_cloth: MeshIO: DNA Mesh: combine repeating UVs 2021-07-08 12:24:33 +05:30
6ff81cd658 modifier: adaptive_remesh: Run split edge of specified edge index
This is for testing the cloth_remesh.cc::Mesh::split_edge_triangulate() function.
2021-07-07 19:24:00 +05:30
3b5cb1d54b adaptive_cloth: Mesh: split_edge_triangulate() 2021-07-07 19:20:21 +05:30
2871ad0f3b adaptive_cloth: fix: Mesh: delete elements bunch of fixes 2021-07-07 19:19:22 +05:30
8926ac9c6b adaptive_cloth: Mesh: get_checked_other_vert() 2021-07-07 19:18:34 +05:30
2bc5186aa3 adaptive_cloth: Mesh: get_checked_node_of_vert() 2021-07-07 19:18:04 +05:30
ad6c40022e adaptive_cloth: Mesh: get_checked_verts_of_edge() 2021-07-07 19:17:22 +05:30
f547143533 adaptive_cloth: Mesh: get_checked_element() 2021-07-07 19:15:15 +05:30
5143a10288 adaptive_cloth: fix: add_empty_interp_element() crash sometimes
Since the elements have a reference to the `Arena`, if the `Arena` changes in size, which can happen because of `add_empty_element()`, then the references can become invalid. Realloc can create memory space elsewhere and copy the contents, the references to the previous memory space are not updated which means references to the previous memory space are invalid.

There are three ways to fix this:
 - Create a copy and work on the copy, this is inefficient
 - Get a reference to that element again, this is efficient but may not be possible always
 - Don't use the reference after an operation that can lead to the invalidation of the reference, this is the most efficient way but may not be possible always

Decided to go with the third way in this case.

Side note: Having a borrow checker completely eliminates such problems. Rust should be the way forward.
2021-07-07 17:54:44 +05:30
3e4a201eae adaptive_cloth: Face: add has_vert_index(), has_edge() 2021-07-07 17:52:15 +05:30
fd467923b9 adaptive_cloth: Edge: make has_vert() const, add get_verts() 2021-07-07 17:50:02 +05:30
3d95f774c8 bli: generational_arena: fix: begin() points to EntryNoExist
When the first element of `Arena::data` is `EntryNoExist`, must iterate over the vector until the first `EntryExist` is found.

For `Arena::end()` this shouldn't be necessary because it should point to the last element + 1 anyway, so the `operator*` on this is meaningless.
2021-07-07 17:40:41 +05:30
128ad36b06 adaptive_cloth: Mesh: delete elements 2021-07-05 21:24:54 +05:30
ab8f971656 adaptive_cloth: Mesh: add empty element with interpolation 2021-07-05 21:24:10 +05:30
bf0438bd46 adaptive_cloth: Mesh: get other vert when given edge and face indices 2021-07-05 21:21:54 +05:30
53309357df adaptive_cloth: MeshDiff: initial 2021-07-04 17:46:34 +05:30
5d0c79ec8a adaptive_cloth: tests: Mesh to MeshIO, include only valid normals and uvs 2021-07-03 20:29:11 +05:30
98ac359545 adaptive_cloth: tests: Mesh: write loose edges 2021-07-03 19:00:08 +05:30
3157770deb adaptive_cloth: Mesh: Write: support loose edges 2021-07-03 18:59:39 +05:30
6a0ed670fd bli: generational_arena: fix: compile error when gtests not enabled 2021-07-03 18:13:33 +05:30
04ca6418f9 adaptive_cloth: Mesh: support loose edges (read only) 2021-07-03 15:03:04 +05:30
90ea4d03ed adaptive_cloth: tests: MeshIO: write DNA Mesh loose edges 2021-07-02 23:23:43 +05:30
86ce842ff3 adaptive_cloth: MeshIO: support line indices for write to DNA Mesh 2021-07-02 23:23:25 +05:30
198f8d5e99 adaptive_cloth: tests: MeshIO: read DNA Mesh loose edges 2021-07-02 20:35:03 +05:30
efacb6fda0 adaptive_cloth: tests: MeshIO: write OBJ loose edges 2021-07-02 20:32:17 +05:30
28fca5d58c adaptive_cloth: tests: MeshIO: read OBJ loose edges 2021-07-02 20:31:51 +05:30
e2eec91e40 adaptive_cloth: MeshIO: support line indices for read DNA Mesh and write OBJ 2021-07-02 20:29:46 +05:30
2fff595dbc cloth: cloth_to_object: create copy only if needed 2021-07-02 15:46:37 +05:30
52ea334923 cloth: create copy of mesh only when needed 2021-07-02 13:33:51 +05:30
440b486603 adaptive_cloth: MeshIO: write DNA Mesh 2021-07-02 12:49:33 +05:30
08d33d0203 adaptive_cloth: MeshIO: test: ReadDNAMesh: finish up 2021-07-01 19:44:45 +05:30
bf82a15db7 adaptive_cloth: fix: MeshIO: write obj normals started with 'v ' instead of 'vn ' 2021-07-01 18:55:36 +05:30
ed500956c3 adaptive_cloth: MeshIO: read DNA Mesh
The conversion was easy enough but the test case for this is extremely difficult.

Creating `Mesh` is not possible without initializing `idtype` using `BKE_idtype_init()` (there should actually be a check for this, at least in debug mode).

Converting this `Mesh` to `BMesh` is simple without any hassles.

Using the `BMesh`, create a cube. Now turns out that is also simple if `BMO_op_callf()` is known about. The previous approach was to create a copy of the code in `bmo_primitive.c` and use that. This also leads to problems because without the `BMOperator` functions pre-applied on the `BMesh`, `BMO_face_flag_enable()` crashes without any proper indication of what could have caused the error. Simplest way to fix is to just remove that flag check. Then found out about `BMO_op_callf()`, this really needs documentation since it has variadic arguments and is magically calling the required operator (printf style).

Now that we have the cube in the `BMesh`, converting it back to `Mesh` is another massive problem. There are many functions that can do this `BM_mesh_bm_to_me()` and `BKE_mesh_from_bmesh_eval_nomain()` are most appropriate. These functions write the CustomData blocks to `Mesh` but before doing do, set the `mvert->co` and such. For some reason, `BMesh` has not updated the blocks so `mvert->co` just has (0.0, 0.0, 0.0). After spending multiple hours on this, found one way to fix this, copy the `BMesh` which then initializes the blocks in the new `BMesh` and this can be used in `BM_mesh_bm_to_me()` to get the `Mesh` that is needed.
2021-07-01 18:34:51 +05:30
95d9b5810b adaptive_cloth: tests: create separate executable for faster compilation 2021-07-01 10:44:51 +05:30
a218df7918 adaptive_cloth: MeshIO: FileType to IOType 2021-06-30 18:25:16 +05:30
a2b0c06663 adaptive_cloth: update references 2021-06-30 10:30:39 +05:30
ea058d61a4 bli: generational_arena: add references 2021-06-30 10:30:15 +05:30
02d8f6a646 adaptive_cloth: Mesh: write()
Creates a MeshIO object.  There are limitations for this as of right
now, check inline comments for details (is a todo), the basic problem
is if the arena has `EntryNoExist` in between elements. This will
cause major problems.
2021-06-24 20:19:55 +05:30
0126abfd6e adaptive_cloth: MeshIO: write obj 2021-06-24 18:14:41 +05:30
72ea9b9e06 adaptive_cloth: MeshReader to MeshIO 2021-06-24 16:50:29 +05:30
e28bb2266b adaptive_cloth: mesh: fix failing test Mesh_Read
Turns out auto doesn't automatically use references even if the function is returning a reference, need to do `auto &`.
2021-06-24 13:35:57 +05:30
8bcd17be05 adaptive_cloth: better debug print 2021-06-24 13:28:50 +05:30
f60100b8ca adaptive_cloth: operator << overload for debug printing 2021-06-24 12:05:19 +05:30
b9fa792e08 bli: generational_arena: ConstIterator
ConstIterator is an iterator where the Iterator cannot change the value stored by the iterator.
2021-06-24 11:02:00 +05:30
acdfde3598 adaptive_cloth: test: mesh: read(), fails, need to find fix 2021-06-24 10:30:00 +05:30
3b28d1486e adaptive_cloth: mesh: abstract out read over MeshReader and fix compiler errors 2021-06-23 13:32:41 +05:30
4796acef66 adaptive_cloth: mesh: read obj to Mesh 2021-06-23 12:17:34 +05:30
255edfa5e1 adaptive_cloth: fix: mesh_reader: obj: 'vt' considered under 'v'
Consider
v 1.0 1.0 1.0
vt 1.0 1.0

Here, both lines start with "v" hence, if the check is, line starts with "v", it satisfies both, which is not correct.

The correct check should be, line starts with "v ".
2021-06-22 23:32:25 +05:30
fed0cdf3cb adaptive_cloth: test: MeshReader simple cube read 2021-06-22 23:31:13 +05:30
2446e978df adaptive_cloth: mesh_reader: obj parse 2021-06-22 21:49:49 +05:30
32441a7ae5 adaptive_cloth: mesh_reader: initial setup 2021-06-22 17:43:38 +05:30
9457c541a5 adaptive_cloth: mesh: add empty elements 2021-06-22 12:25:40 +05:30
11ad8fa732 adaptive_cloth: mesh elements, better constructors 2021-06-22 12:25:04 +05:30
ff2db09f55 bli: generational_arena: add iterator support
Made as a bidirectional iterator since movement can be in both
directions. Random access iterator is not possible since there can be
gaps in between the elements.

Had a very annoying bug- using the iterator with the standard library
would throw an error "`iterator_category` not defined" even though it
was defined. Spent a lot of time to realize that `difference_type`
should also be defined but other types within the iterator class are
optional. For some reason the compiler does not create the
`iterator_trait` correctly if `difference_type` is missing but throws
error about `iterator_category` which is extremely strange and time consuming to debug :(
2021-06-21 23:39:56 +05:30
476610dfae bli: generational_arena: insert_with() and try_insert_with() 2021-06-19 23:54:06 +05:30
b58ba3aa47 bli: generational_arena: use better constructor and better if-else 2021-06-19 23:53:38 +05:30
d5f8d9380f adaptive_cloth: mesh: initial class setup 2021-06-18 14:52:22 +05:30
30b9dc6a01 bli: generational_arena: better code styling 2021-06-17 13:36:16 +05:30
7f194771f7 bli: generational_arena: test for ensuring next_free list is correct 2021-06-16 19:17:34 +05:30
e48607a0c0 bli: generational_arena: extra insert() test case with fix
When the capacity of the `Arena` is 0, need to handle it specially.
2021-06-16 14:53:11 +05:30
0ba4520162 bli: generational_arena: remove() with test 2021-06-16 14:21:15 +05:30
7de7ac55d2 bli: generational_arena: get related tests and respective fixes 2021-06-16 13:56:28 +05:30
0620fbbb94 bli: generational_arena: tests, size(), capacity(), fix some errors 2021-06-16 12:45:39 +05:30
805e2ccb07 bli: generational_arena: get(), get_no_gen(), get_no_gen_index() 2021-06-15 22:18:33 +05:30
20497c448c bli: generational_arena: insert() 2021-06-15 21:42:33 +05:30
bc62878f98 bli: generational_arena: constructors and reserve() 2021-06-15 12:48:10 +05:30
1deefd940f bli: generational_arena: doc: how it works 2021-06-15 12:01:57 +05:30
1e50ce9284 bli: generational_arena: fix: compile errors 2021-06-15 11:40:38 +05:30
ebfeab8fde bli: generational_arena: class declaration setup 2021-06-14 22:02:01 +05:30
07b52c9fb6 adaptive_cloth: run BKE_cloth_remesh() when remesh flag is on 2021-06-11 21:19:39 +05:30
ad5d6448f2 adaptive_cloth: ui: add remesh option within shape 2021-06-11 19:42:55 +05:30
87ade2a279 adaptive_cloth: do_step_cloth() should update the input mesh 2021-06-11 13:22:52 +05:30
d4be1bfb81 adaptive_cloth: clothModifier_do() returns a new Mesh if simulation was successful
This is an important change that allows for remeshing operations in
the cloth simulator. `clothModifier_do()` returns the resulting mesh
if it was successful otherwise NULL.
2021-06-11 12:19:52 +05:30
57c1f52d2e adaptive_cloth: initial conversion of cloth modifier to modifyMesh
from `deformVerts`

Adaptive remeshing requires the mesh connectivity to change, so the
modifier should be of `eModifierTypeType_Nonconstructive` type and use
the `modifyMesh()` function instead of the `deformVerts()` function.

The next step is to make the `clothModifier_do()` function to take
advantage of the mesh given to it since now that mesh can be edited by
it and returned directly.
2021-06-10 12:06:03 +05:30
c31f095edf adaptive_remesh: create a new modifier 2021-06-09 10:11:24 +05:30
358 changed files with 59335 additions and 116 deletions

View File

@@ -0,0 +1,49 @@
# - Find MessagePack (msgpack) library
# Find the native MessagePack includes and library
# This module defines
# MSGPACK_INCLUDE_DIRS, where to find spnav.h, Set when
# MSGPACK_INCLUDE_DIR is found.
# MSGPACK_ROOT_DIR, The base directory to search for msgpack.
# This can also be an environment variable.
# MSGPACK_FOUND, If false, do not try to use msgpack.
#
#=============================================================================
# Copyright 2021 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If MSGPACK_ROOT_DIR was defined in the environment, use it.
IF(NOT MSGPACK_ROOT_DIR AND NOT $ENV{MSGPACK_ROOT_DIR} STREQUAL "")
SET(MSGPACK_ROOT_DIR $ENV{MSGPACK_ROOT_DIR})
ENDIF()
SET(_msgpack_SEARCH_DIRS
${MSGPACK_ROOT_DIR}
)
FIND_PATH(MSGPACK_INCLUDE_DIR
NAMES
msgpack/include/msgpack.hpp
HINTS
${_msgpack_SEARCH_DIRS}
PATH_SUFFIXES
include/msgpack
)
# handle the QUIETLY and REQUIRED arguments and set MSGPACK_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Msgpack DEFAULT_MSG
MSGPACK_INCLUDE_DIR)
IF(MSGPACK_FOUND)
SET(MSGPACK_INCLUDE_DIRS ${MSGPACK_INCLUDE_DIR})
ENDIF()
MARK_AS_ADVANCED(
MSGPACK_INCLUDE_DIR
)
UNSET(_msgpack_SEARCH_DIRS)

22
extern/msgpack/include/msgpack.hpp vendored Normal file
View File

@@ -0,0 +1,22 @@
//
// MessagePack for C++
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#include "msgpack/object.hpp"
#include "msgpack/iterator.hpp"
#include "msgpack/zone.hpp"
#include "msgpack/pack.hpp"
#include "msgpack/null_visitor.hpp"
#include "msgpack/parse.hpp"
#include "msgpack/unpack.hpp"
#include "msgpack/x3_parse.hpp"
#include "msgpack/x3_unpack.hpp"
#include "msgpack/sbuffer.hpp"
#include "msgpack/vrefbuffer.hpp"
#include "msgpack/version.hpp"
#include "msgpack/type.hpp"

View File

@@ -0,0 +1,19 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015-2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_ADAPTOR_BASE_HPP
#define MSGPACK_ADAPTOR_BASE_HPP
#include "msgpack/adaptor/adaptor_base_decl.hpp"
#include "msgpack/v1/adaptor/adaptor_base.hpp"
#include "msgpack/v2/adaptor/adaptor_base.hpp"
#include "msgpack/v3/adaptor/adaptor_base.hpp"
#endif // MSGPACK_ADAPTOR_BASE_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_ADAPTOR_BASE_DECL_HPP
#define MSGPACK_ADAPTOR_BASE_DECL_HPP
#include "msgpack/v1/adaptor/adaptor_base_decl.hpp"
#include "msgpack/v2/adaptor/adaptor_base_decl.hpp"
#include "msgpack/v3/adaptor/adaptor_base_decl.hpp"
#endif // MSGPACK_ADAPTOR_BASE_DECL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_ARRAY_REF_HPP
#define MSGPACK_TYPE_ARRAY_REF_HPP
#include "msgpack/adaptor/array_ref_decl.hpp"
#include "msgpack/v1/adaptor/array_ref.hpp"
#endif // MSGPACK_TYPE_ARRAY_REFL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_ARRAY_REF_DECL_HPP
#define MSGPACK_TYPE_ARRAY_REF_DECL_HPP
#include "msgpack/v1/adaptor/array_ref_decl.hpp"
#include "msgpack/v2/adaptor/array_ref_decl.hpp"
#include "msgpack/v3/adaptor/array_ref_decl.hpp"
#endif // MSGPACK_TYPE_ARRAY_REF_DECL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_BOOL_HPP
#define MSGPACK_TYPE_BOOL_HPP
#include "msgpack/v1/adaptor/bool.hpp"
#endif // MSGPACK_TYPE_BOOL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_BOOST_FUSION_HPP
#define MSGPACK_TYPE_BOOST_FUSION_HPP
#include "msgpack/v1/adaptor/boost/fusion.hpp"
#endif // MSGPACK_TYPE_BOOST_FUSION_HPP

View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015-2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_HPP
#define MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_HPP
#include "msgpack/adaptor/boost/msgpack_variant_decl.hpp"
#include "msgpack/v1/adaptor/boost/msgpack_variant.hpp"
//#include "msgpack/v2/adaptor/boost/msgpack_variant.hpp"
#endif // MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_DECL_HPP
#define MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_DECL_HPP
#include "msgpack/v1/adaptor/boost/msgpack_variant_decl.hpp"
#include "msgpack/v2/adaptor/boost/msgpack_variant_decl.hpp"
#include "msgpack/v3/adaptor/boost/msgpack_variant_decl.hpp"
#endif // MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_DECL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_BOOST_OPTIONAL_HPP
#define MSGPACK_TYPE_BOOST_OPTIONAL_HPP
#include "msgpack/v1/adaptor/boost/optional.hpp"
#endif // MSGPACK_TYPE_BOOST_OPTIONAL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_BOOST_STRING_REF_HPP
#define MSGPACK_TYPE_BOOST_STRING_REF_HPP
#include "msgpack/v1/adaptor/boost/string_ref.hpp"
#endif // MSGPACK_TYPE_BOOST_STRING_REF_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2017 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_BOOST_STRING_VIEW_HPP
#define MSGPACK_TYPE_BOOST_STRING_VIEW_HPP
#include "msgpack/v1/adaptor/boost/string_view.hpp"
#endif // MSGPACK_TYPE_BOOST_STRING_VIEW_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CARRAY_HPP
#define MSGPACK_TYPE_CARRAY_HPP
#include "msgpack/v1/adaptor/carray.hpp"
#endif // MSGPACK_TYPE_CARRAY_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CHAR_PTR_HPP
#define MSGPACK_TYPE_CHAR_PTR_HPP
#include "msgpack/v1/adaptor/char_ptr.hpp"
#endif // MSGPACK_TYPE_CHAR_PTR_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015-2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_CHECK_CONTAINER_SIZE_HPP
#define MSGPACK_CHECK_CONTAINER_SIZE_HPP
#include "msgpack/adaptor/check_container_size_decl.hpp"
#include "msgpack/v1/adaptor/check_container_size.hpp"
#endif // MSGPACK_CHECK_CONTAINER_SIZE_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_CHECK_CONTAINER_SIZE_DECL_HPP
#define MSGPACK_CHECK_CONTAINER_SIZE_DECL_HPP
#include "msgpack/v1/adaptor/check_container_size_decl.hpp"
#include "msgpack/v2/adaptor/check_container_size_decl.hpp"
#include "msgpack/v3/adaptor/check_container_size_decl.hpp"
#endif // MSGPACK_CHECK_CONTAINER_SIZE_DECL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2020 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_COMPLEX_HPP
#define MSGPACK_TYPE_COMPLEX_HPP
#include "msgpack/v1/adaptor/complex.hpp"
#endif // MSGPACK_TYPE_COMPLEX_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_ARRAY_HPP
#define MSGPACK_TYPE_CPP11_ARRAY_HPP
#include "msgpack/v1/adaptor/cpp11/array.hpp"
#endif // MSGPACK_TYPE_CPP11_ARRAY_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_ARRAY_CHAR_HPP
#define MSGPACK_TYPE_CPP11_ARRAY_CHAR_HPP
#include "msgpack/v1/adaptor/cpp11/array_char.hpp"
#endif // MSGPACK_TYPE_CPP11_ARRAY_CHAR_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_ARRAY_UNSIGNED_CHAR_HPP
#define MSGPACK_TYPE_CPP11_ARRAY_UNSIGNED_CHAR_HPP
#include "msgpack/v1/adaptor/cpp11/array_unsigned_char.hpp"
#endif // MSGPACK_TYPE_CPP11_ARRAY_UNSIGNED_CHAR_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2017 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_CHRONO_HPP
#define MSGPACK_TYPE_CPP11_CHRONO_HPP
#include "msgpack/v1/adaptor/cpp11/chrono.hpp"
#endif // MSGPACK_TYPE_CPP11_CHRONO_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_FORWARD_LIST_HPP
#define MSGPACK_TYPE_CPP11_FORWARD_LIST_HPP
#include "msgpack/v1/adaptor/cpp11/forward_list.hpp"
#endif // MSGPACK_TYPE_CPP11_FORWARD_LIST_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_REFERENCE_WRAPPER_HPP
#define MSGPACK_TYPE_CPP11_REFERENCE_WRAPPER_HPP
#include "msgpack/v1/adaptor/cpp11/reference_wrapper.hpp"
#endif // MSGPACK_TYPE_CPP11_REFERENCE_WRAPPER_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_SHARED_PTR_HPP
#define MSGPACK_TYPE_CPP11_SHARED_PTR_HPP
#include "msgpack/v1/adaptor/cpp11/shared_ptr.hpp"
#endif // MSGPACK_TYPE_CPP11_SHARED_PTR_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2019 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_TIMESPEC_HPP
#define MSGPACK_TYPE_CPP11_TIMESPEC_HPP
#include "msgpack/v1/adaptor/cpp11/timespec.hpp"
#endif // MSGPACK_TYPE_CPP11_TIMESPEC_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_TUPLE_HPP
#define MSGPACK_TYPE_CPP11_TUPLE_HPP
#include "msgpack/v1/adaptor/cpp11/tuple.hpp"
#endif // MSGPACK_TYPE_CPP11_TUPLE_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_UNIQUE_PTR_HPP
#define MSGPACK_TYPE_CPP11_UNIQUE_PTR_HPP
#include "msgpack/v1/adaptor/cpp11/unique_ptr.hpp"
#endif // MSGPACK_TYPE_CPP11_UNIQUE_PTR_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_UNORDERED_MAP_HPP
#define MSGPACK_TYPE_CPP11_UNORDERED_MAP_HPP
#include "msgpack/v1/adaptor/cpp11/unordered_map.hpp"
#endif // MSGPACK_TYPE_CPP11_UNORDERED_MAP_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP11_UNORDERED_SET_HPP
#define MSGPACK_TYPE_CPP11_UNORDERED_SET_HPP
#include "msgpack/v1/adaptor/cpp11/unordered_set.hpp"
#endif // MSGPACK_TYPE_CPP11_UNORDERED_SET_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP17_BYTE_HPP
#define MSGPACK_TYPE_CPP17_BYTE_HPP
#include "msgpack/v1/adaptor/cpp17/byte.hpp"
#endif // MSGPACK_TYPE_CPP17_BYTE_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP17_CARRAY_BYTE_HPP
#define MSGPACK_TYPE_CPP17_CARRAY_BYTE_HPP
#include "msgpack/v1/adaptor/cpp17/carray_byte.hpp"
#endif // MSGPACK_TYPE_CPP17_CARRAY_BYTE_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2017 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP17_OPTIONAL_HPP
#define MSGPACK_TYPE_CPP17_OPTIONAL_HPP
#include "msgpack/v1/adaptor/cpp17/optional.hpp"
#endif // MSGPACK_TYPE_CPP17_OPTIONAL_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2017 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP17_STRING_VIEW_HPP
#define MSGPACK_TYPE_CPP17_STRING_VIEW_HPP
#include "msgpack/v1/adaptor/cpp17/string_view.hpp"
#endif // MSGPACK_TYPE_CPP17_STRING_VIEW_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP17_VECTOR_BYTE_HPP
#define MSGPACK_TYPE_CPP17_VECTOR_BYTE_HPP
#include "msgpack/v1/adaptor/cpp17/vector_byte.hpp"
#endif // MSGPACK_TYPE_CPP17_VECTOR_BYTE_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_DEFINE_HPP
#define MSGPACK_DEFINE_HPP
#include "msgpack/adaptor/define_decl.hpp"
#include "msgpack/v1/adaptor/define.hpp"
#endif // MSGPACK_DEFINE_HPP

View File

@@ -0,0 +1,144 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_DEFINE_DECL_HPP
#define MSGPACK_DEFINE_DECL_HPP
// BOOST_PP_VARIADICS is defined in boost/preprocessor/config/config.hpp
// http://www.boost.org/libs/preprocessor/doc/ref/variadics.html
// However, supporting compiler detection is not complete. msgpack-c requires
// variadic macro arguments support. So BOOST_PP_VARIADICS is defined here explicitly.
#if !defined(BOOST_PP_VARIADICS)
#define BOOST_PP_VARIADICS
#endif
#include <boost/preprocessor.hpp>
#include "msgpack/versioning.hpp"
// for MSGPACK_ADD_ENUM
#include "msgpack/adaptor/int.hpp"
#define MSGPACK_DEFINE_ARRAY(...) \
template <typename Packer> \
void msgpack_pack(Packer& msgpack_pk) const \
{ \
msgpack::type::make_define_array(__VA_ARGS__).msgpack_pack(msgpack_pk); \
} \
void msgpack_unpack(msgpack::object const& msgpack_o) \
{ \
msgpack::type::make_define_array(__VA_ARGS__).msgpack_unpack(msgpack_o); \
}\
template <typename MSGPACK_OBJECT> \
void msgpack_object(MSGPACK_OBJECT* msgpack_o, msgpack::zone& msgpack_z) const \
{ \
msgpack::type::make_define_array(__VA_ARGS__).msgpack_object(msgpack_o, msgpack_z); \
}
#define MSGPACK_BASE_ARRAY(base) (*const_cast<base *>(static_cast<base const*>(this)))
#define MSGPACK_NVP(name, value) (name) (value)
#define MSGPACK_DEFINE_MAP_EACH_PROC(r, data, elem) \
BOOST_PP_IF( \
BOOST_PP_IS_BEGIN_PARENS(elem), \
elem, \
(BOOST_PP_STRINGIZE(elem))(elem) \
)
#define MSGPACK_DEFINE_MAP_IMPL(...) \
BOOST_PP_SEQ_TO_TUPLE( \
BOOST_PP_SEQ_FOR_EACH( \
MSGPACK_DEFINE_MAP_EACH_PROC, \
0, \
BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__) \
) \
)
#define MSGPACK_DEFINE_MAP(...) \
template <typename Packer> \
void msgpack_pack(Packer& msgpack_pk) const \
{ \
msgpack::type::make_define_map \
MSGPACK_DEFINE_MAP_IMPL(__VA_ARGS__) \
.msgpack_pack(msgpack_pk); \
} \
void msgpack_unpack(msgpack::object const& msgpack_o) \
{ \
msgpack::type::make_define_map \
MSGPACK_DEFINE_MAP_IMPL(__VA_ARGS__) \
.msgpack_unpack(msgpack_o); \
}\
template <typename MSGPACK_OBJECT> \
void msgpack_object(MSGPACK_OBJECT* msgpack_o, msgpack::zone& msgpack_z) const \
{ \
msgpack::type::make_define_map \
MSGPACK_DEFINE_MAP_IMPL(__VA_ARGS__) \
.msgpack_object(msgpack_o, msgpack_z); \
}
#define MSGPACK_BASE_MAP(base) \
(BOOST_PP_STRINGIZE(base))(*const_cast<base *>(static_cast<base const*>(this)))
// MSGPACK_ADD_ENUM must be used in the global namespace.
#define MSGPACK_ADD_ENUM(enum_name) \
namespace msgpack { \
/** @cond */ \
MSGPACK_API_VERSION_NAMESPACE(MSGPACK_DEFAULT_API_NS) { \
/** @endcond */ \
namespace adaptor { \
template<> \
struct convert<enum_name> { \
msgpack::object const& operator()(msgpack::object const& msgpack_o, enum_name& msgpack_v) const { \
msgpack::underlying_type<enum_name>::type tmp; \
msgpack::operator>>(msgpack_o, tmp); \
msgpack_v = static_cast<enum_name>(tmp); \
return msgpack_o; \
} \
}; \
template<> \
struct object<enum_name> { \
void operator()(msgpack::object& msgpack_o, const enum_name& msgpack_v) const { \
msgpack::underlying_type<enum_name>::type tmp = static_cast<msgpack::underlying_type<enum_name>::type>(msgpack_v); \
msgpack::operator<<(msgpack_o, tmp); \
} \
}; \
template<> \
struct object_with_zone<enum_name> { \
void operator()(msgpack::object::with_zone& msgpack_o, const enum_name& msgpack_v) const { \
msgpack::underlying_type<enum_name>::type tmp = static_cast<msgpack::underlying_type<enum_name>::type>(msgpack_v); \
msgpack::operator<<(msgpack_o, tmp); \
} \
}; \
template <> \
struct pack<enum_name> { \
template <typename Stream> \
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& msgpack_o, const enum_name& msgpack_v) const { \
return msgpack::operator<<(msgpack_o, static_cast<msgpack::underlying_type<enum_name>::type>(msgpack_v)); \
} \
}; \
} \
/** @cond */ \
} \
/** @endcond */ \
}
#if defined(MSGPACK_USE_DEFINE_MAP)
#define MSGPACK_DEFINE MSGPACK_DEFINE_MAP
#define MSGPACK_BASE MSGPACK_BASE_MAP
#else // defined(MSGPACK_USE_DEFINE_MAP)
#define MSGPACK_DEFINE MSGPACK_DEFINE_ARRAY
#define MSGPACK_BASE MSGPACK_BASE_ARRAY
#endif // defined(MSGPACK_USE_DEFINE_MAP)
#include "msgpack/v1/adaptor/define_decl.hpp"
#include "msgpack/v2/adaptor/define_decl.hpp"
#include "msgpack/v3/adaptor/define_decl.hpp"
#endif // MSGPACK_DEFINE_DECL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_DEQUE_HPP
#define MSGPACK_TYPE_DEQUE_HPP
#include "msgpack/v1/adaptor/deque.hpp"
#endif // MSGPACK_TYPE_DEQUE_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_EXT_HPP
#define MSGPACK_TYPE_EXT_HPP
#include "msgpack/adaptor/ext_decl.hpp"
#include "msgpack/v1/adaptor/ext.hpp"
#endif // MSGPACK_TYPE_EXT_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_EXT_DECL_HPP
#define MSGPACK_TYPE_EXT_DECL_HPP
#include "msgpack/v1/adaptor/ext_decl.hpp"
#include "msgpack/v2/adaptor/ext_decl.hpp"
#include "msgpack/v3/adaptor/ext_decl.hpp"
#endif // MSGPACK_TYPE_EXT_DECL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_FIXINT_HPP
#define MSGPACK_TYPE_FIXINT_HPP
#include "msgpack/adaptor/fixint_decl.hpp"
#include "msgpack/v1/adaptor/fixint.hpp"
#endif // MSGPACK_TYPE_FIXINT_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_FIXINT_DECL_HPP
#define MSGPACK_TYPE_FIXINT_DECL_HPP
#include "msgpack/v1/adaptor/fixint_decl.hpp"
#include "msgpack/v2/adaptor/fixint_decl.hpp"
#include "msgpack/v3/adaptor/fixint_decl.hpp"
#endif // MSGPACK_TYPE_FIXINT_DECL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_FLOAT_HPP
#define MSGPACK_TYPE_FLOAT_HPP
#include "msgpack/v1/adaptor/float.hpp"
#endif // MSGPACK_TYPE_FLOAT_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_INT_HPP
#define MSGPACK_TYPE_INT_HPP
#include "msgpack/adaptor/int_decl.hpp"
#include "msgpack/v1/adaptor/int.hpp"
#endif // MSGPACK_TYPE_INT_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_INT_DECL_HPP
#define MSGPACK_TYPE_INT_DECL_HPP
#include "msgpack/v1/adaptor/int_decl.hpp"
#include "msgpack/v2/adaptor/int_decl.hpp"
#include "msgpack/v3/adaptor/int_decl.hpp"
#endif // MSGPACK_TYPE_INT_DECL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_LIST_HPP
#define MSGPACK_TYPE_LIST_HPP
#include "msgpack/v1/adaptor/list.hpp"
#endif // MSGPACK_TYPE_LIST_HPP

View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_MAP_HPP
#define MSGPACK_TYPE_MAP_HPP
#include "msgpack/adaptor/map_decl.hpp"
#include "msgpack/v1/adaptor/map.hpp"
#endif // MSGPACK_TYPE_MAP_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_MAP_DECL_HPP
#define MSGPACK_TYPE_MAP_DECL_HPP
#include "msgpack/v1/adaptor/map_decl.hpp"
#include "msgpack/v2/adaptor/map_decl.hpp"
#include "msgpack/v3/adaptor/map_decl.hpp"
#endif // MSGPACK_TYPE_MAP_DECL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2014 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_MSGPACK_TUPLE_HPP
#define MSGPACK_MSGPACK_TUPLE_HPP
#include "msgpack/adaptor/msgpack_tuple_decl.hpp"
#include "msgpack/v1/adaptor/msgpack_tuple.hpp"
#endif // MSGPACK_MSGPACK_TUPLE_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_MSGPACK_TUPLE_DECL_HPP
#define MSGPACK_MSGPACK_TUPLE_DECL_HPP
#include "msgpack/v1/adaptor/msgpack_tuple_decl.hpp"
#include "msgpack/v2/adaptor/msgpack_tuple_decl.hpp"
#include "msgpack/v3/adaptor/msgpack_tuple_decl.hpp"
#endif // MSGPACK_MSGPACK_TUPLE_DECL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_NIL_HPP
#define MSGPACK_TYPE_NIL_HPP
#include "msgpack/adaptor/nil_decl.hpp"
#include "msgpack/v1/adaptor/nil.hpp"
#endif // MSGPACK_TYPE_NIL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_NIL_DECL_HPP
#define MSGPACK_TYPE_NIL_DECL_HPP
#include "msgpack/v1/adaptor/nil_decl.hpp"
#include "msgpack/v2/adaptor/nil_decl.hpp"
#include "msgpack/v3/adaptor/nil_decl.hpp"
#endif // MSGPACK_TYPE_NIL_DECL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_PAIR_HPP
#define MSGPACK_TYPE_PAIR_HPP
#include "msgpack/v1/adaptor/pair.hpp"
#endif // MSGPACK_TYPE_PAIR_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_RAW_HPP
#define MSGPACK_TYPE_RAW_HPP
#include "msgpack/adaptor/raw_decl.hpp"
#include "msgpack/v1/adaptor/raw.hpp"
#endif // MSGPACK_TYPE_RAW_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_RAW_DECL_HPP
#define MSGPACK_TYPE_RAW_DECL_HPP
#include "msgpack/v1/adaptor/raw_decl.hpp"
#include "msgpack/v2/adaptor/raw_decl.hpp"
#include "msgpack/v3/adaptor/raw_decl.hpp"
#endif // MSGPACK_TYPE_RAW_DECL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_SET_HPP
#define MSGPACK_TYPE_SET_HPP
#include "msgpack/v1/adaptor/set.hpp"
#endif // MSGPACK_TYPE_SET_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_SIZE_EQUAL_ONLY_HPP
#define MSGPACK_TYPE_SIZE_EQUAL_ONLY_HPP
#include "msgpack/adaptor/size_equal_only_decl.hpp"
#include "msgpack/v1/adaptor/size_equal_only.hpp"
#endif // MSGPACK_TYPE_SIZE_EQUAL_ONLYL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_SIZE_EQUAL_ONLY_DECL_HPP
#define MSGPACK_TYPE_SIZE_EQUAL_ONLY_DECL_HPP
#include "msgpack/v1/adaptor/size_equal_only_decl.hpp"
#include "msgpack/v2/adaptor/size_equal_only_decl.hpp"
#include "msgpack/v3/adaptor/size_equal_only_decl.hpp"
#endif // MSGPACK_TYPE_SIZE_EQUAL_ONLY_DECL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_STRING_HPP
#define MSGPACK_TYPE_STRING_HPP
#include "msgpack/v1/adaptor/string.hpp"
#endif // MSGPACK_TYPE_STRING_HPP

View File

@@ -0,0 +1,171 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_TR1_UNORDERED_MAP_HPP
#define MSGPACK_TYPE_TR1_UNORDERED_MAP_HPP
#include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/adaptor/check_container_size.hpp"
#if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
#define MSGPACK_HAS_STD_UNORDERED_MAP
#include <unordered_map>
#define MSGPACK_STD_TR1 std
#else // defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
#if __GNUC__ >= 4
#define MSGPACK_HAS_STD_TR1_UNORDERED_MAP
#include <tr1/unordered_map>
#define MSGPACK_STD_TR1 std::tr1
#endif // __GNUC__ >= 4
#endif // defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
#if defined(MSGPACK_STD_TR1)
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v1) {
/// @endcond
namespace adaptor {
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
struct convert<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> > {
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>& v) const {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
msgpack::object_kv* p(o.via.map.ptr);
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> tmp;
for(; p != pend; ++p) {
K key;
p->key.convert(key);
p->val.convert(tmp[key]);
}
tmp.swap(v);
return o;
}
};
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
struct pack<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> > {
template <typename Stream>
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>& v) const {
uint32_t size = checked_get_container_size(v.size());
o.pack_map(size);
for(typename MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin()), it_end(v.end());
it != it_end; ++it) {
o.pack(it->first);
o.pack(it->second);
}
return o;
}
};
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
struct object_with_zone<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> > {
void operator()(msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>& v) const {
o.type = msgpack::type::MAP;
if(v.empty()) {
o.via.map.ptr = MSGPACK_NULLPTR;
o.via.map.size = 0;
} else {
uint32_t size = checked_get_container_size(v.size());
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*size, MSGPACK_ZONE_ALIGNOF(msgpack::object_kv)));
msgpack::object_kv* const pend = p + size;
o.via.map.ptr = p;
o.via.map.size = size;
typename MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin());
do {
p->key = msgpack::object(it->first, o.zone);
p->val = msgpack::object(it->second, o.zone);
++p;
++it;
} while(p < pend);
}
}
};
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
struct convert<MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> > {
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>& v) const {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
msgpack::object_kv* p(o.via.map.ptr);
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> tmp;
for(; p != pend; ++p) {
std::pair<K, V> value;
p->key.convert(value.first);
p->val.convert(value.second);
tmp.insert(value);
}
tmp.swap(v);
return o;
}
};
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
struct pack<MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> > {
template <typename Stream>
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>& v) const {
uint32_t size = checked_get_container_size(v.size());
o.pack_map(size);
for(typename MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin()), it_end(v.end());
it != it_end; ++it) {
o.pack(it->first);
o.pack(it->second);
}
return o;
}
};
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
struct object_with_zone<MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> > {
void operator()(msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>& v) const {
o.type = msgpack::type::MAP;
if(v.empty()) {
o.via.map.ptr = MSGPACK_NULLPTR;
o.via.map.size = 0;
} else {
uint32_t size = checked_get_container_size(v.size());
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*size, MSGPACK_ZONE_ALIGNOF(msgpack::object_kv)));
msgpack::object_kv* const pend = p + size;
o.via.map.ptr = p;
o.via.map.size = size;
typename MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin());
do {
p->key = msgpack::object(it->first, o.zone);
p->val = msgpack::object(it->second, o.zone);
++p;
++it;
} while(p < pend);
}
}
};
} // namespace adaptor
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v1)
/// @endcond
} // namespace msgpack
#undef MSGPACK_STD_TR1
#endif // MSGPACK_STD_TR1
#endif // MSGPACK_TYPE_TR1_UNORDERED_MAP_HPP

View File

@@ -0,0 +1,165 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_TR1_UNORDERED_SET_HPP
#define MSGPACK_TYPE_TR1_UNORDERED_SET_HPP
#include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/adaptor/check_container_size.hpp"
#if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
#define MSGPACK_HAS_STD_UNORDERED_SET
#include <unordered_set>
#define MSGPACK_STD_TR1 std
#else // defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
#if __GNUC__ >= 4
#define MSGPACK_HAS_STD_TR1_UNORDERED_SET
#include <tr1/unordered_set>
#define MSGPACK_STD_TR1 std::tr1
#endif // __GNUC__ >= 4
#endif // defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
#if defined(MSGPACK_STD_TR1)
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v1) {
/// @endcond
namespace adaptor {
template <typename T, typename Hash, typename Compare, typename Alloc>
struct convert<MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc> > {
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>& v) const {
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
msgpack::object* p = o.via.array.ptr + o.via.array.size;
msgpack::object* const pbegin = o.via.array.ptr;
MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc> tmp;
while(p > pbegin) {
--p;
tmp.insert(p->as<T>());
}
tmp.swap(v);
return o;
}
};
template <typename T, typename Hash, typename Compare, typename Alloc>
struct pack<MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc> > {
template <typename Stream>
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>& v) const {
uint32_t size = checked_get_container_size(v.size());
o.pack_array(size);
for(typename MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>::const_iterator it(v.begin()), it_end(v.end());
it != it_end; ++it) {
o.pack(*it);
}
return o;
}
};
template <typename T, typename Hash, typename Compare, typename Alloc>
struct object_with_zone<MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc> > {
void operator()(msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>& v) const {
o.type = msgpack::type::ARRAY;
if(v.empty()) {
o.via.array.ptr = MSGPACK_NULLPTR;
o.via.array.size = 0;
} else {
uint32_t size = checked_get_container_size(v.size());
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*size, MSGPACK_ZONE_ALIGNOF(msgpack::object)));
msgpack::object* const pend = p + size;
o.via.array.ptr = p;
o.via.array.size = size;
typename MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>::const_iterator it(v.begin());
do {
*p = msgpack::object(*it, o.zone);
++p;
++it;
} while(p < pend);
}
}
};
template <typename T, typename Hash, typename Compare, typename Alloc>
struct convert<MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc> > {
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>& v) const {
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
msgpack::object* p = o.via.array.ptr + o.via.array.size;
msgpack::object* const pbegin = o.via.array.ptr;
MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc> tmp;
while(p > pbegin) {
--p;
tmp.insert(p->as<T>());
}
tmp.swap(v);
return o;
}
};
template <typename T, typename Hash, typename Compare, typename Alloc>
struct pack<MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc> > {
template <typename Stream>
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>& v) const {
uint32_t size = checked_get_container_size(v.size());
o.pack_array(size);
for(typename MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>::const_iterator it(v.begin()), it_end(v.end());
it != it_end; ++it) {
o.pack(*it);
}
return o;
}
};
template <typename T, typename Hash, typename Compare, typename Alloc>
struct object_with_zone<MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc> > {
void operator()(msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>& v) const {
o.type = msgpack::type::ARRAY;
if(v.empty()) {
o.via.array.ptr = MSGPACK_NULLPTR;
o.via.array.size = 0;
} else {
uint32_t size = checked_get_container_size(v.size());
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*size, MSGPACK_ZONE_ALIGNOF(msgpack::object)));
msgpack::object* const pend = p + size;
o.via.array.ptr = p;
o.via.array.size = size;
typename MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>::const_iterator it(v.begin());
do {
*p = msgpack::object(*it, o.zone);
++p;
++it;
} while(p < pend);
}
}
};
} // namespace adaptor
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v1)
/// @endcond
} // namespace msgpack
#undef MSGPACK_STD_TR1
#endif // MSGPACK_STD_TR1
#endif // MSGPACK_TYPE_TR1_UNORDERED_SET_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_V4RAW_HPP
#define MSGPACK_TYPE_V4RAW_HPP
#include "msgpack/adaptor/v4raw_decl.hpp"
#include "msgpack/v1/adaptor/v4raw.hpp"
#endif // MSGPACK_TYPE_V4RAW_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_V4RAW_DECL_HPP
#define MSGPACK_TYPE_V4RAW_DECL_HPP
#include "msgpack/v1/adaptor/v4raw_decl.hpp"
#include "msgpack/v2/adaptor/v4raw_decl.hpp"
#include "msgpack/v3/adaptor/v4raw_decl.hpp"
#endif // MSGPACK_TYPE_V4RAW_DECL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_VECTOR_HPP
#define MSGPACK_TYPE_VECTOR_HPP
#include "msgpack/v1/adaptor/vector.hpp"
#endif // MSGPACK_TYPE_VECTOR_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_VECTOR_BOOL_HPP
#define MSGPACK_TYPE_VECTOR_BOOL_HPP
#include "msgpack/v1/adaptor/vector_bool.hpp"
#endif // MSGPACK_TYPE_VECTOR_BOOL_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_VECTOR_CHAR_HPP
#define MSGPACK_TYPE_VECTOR_CHAR_HPP
#include "msgpack/v1/adaptor/vector_char.hpp"
#endif // MSGPACK_TYPE_VECTOR_CHAR_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_VECTOR_UNSIGNED_CHAR_HPP
#define MSGPACK_TYPE_VECTOR_UNSIGNED_CHAR_HPP
#include "msgpack/v1/adaptor/vector_unsigned_char.hpp"
#endif // MSGPACK_TYPE_VECTOR_UNSIGNED_CHAR_HPP

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_WSTRING_HPP
#define MSGPACK_TYPE_WSTRING_HPP
#include "msgpack/v1/adaptor/wstring.hpp"
#endif // MSGPACK_TYPE_WSTRING_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ C++03/C++11 Adaptation
//
// Copyright (C) 2013-2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_CPP_CONFIG_HPP
#define MSGPACK_CPP_CONFIG_HPP
#include "msgpack/cpp_config_decl.hpp"
#include "msgpack/v1/cpp_config.hpp"
#endif // MSGPACK_CPP_CONFIG_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ C++03/C++11 Adaptation
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_CPP_CONFIG_DECL_HPP
#define MSGPACK_CPP_CONFIG_DECL_HPP
#include "msgpack/v1/cpp_config_decl.hpp"
#include "msgpack/v2/cpp_config_decl.hpp"
#include "msgpack/v3/cpp_config_decl.hpp"
#endif // MSGPACK_CPP_CONFIG_DECL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_CREATE_OBJECT_VISITOR_HPP
#define MSGPACK_CREATE_OBJECT_VISITOR_HPP
#include "msgpack/create_object_visitor_decl.hpp"
#include "msgpack/v2/create_object_visitor.hpp"
#endif // MSGPACK_CREATE_OBJECT_VISITOR_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_CREATE_OBJECT_VISITOR_DECL_HPP
#define MSGPACK_CREATE_OBJECT_VISITOR_DECL_HPP
#include "msgpack/v2/create_object_visitor_decl.hpp"
#include "msgpack/v3/create_object_visitor_decl.hpp"
#endif // MSGPACK_CREATE_OBJECT_VISITOR_DECL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ FILE* buffer adaptor
//
// Copyright (C) 2013 Vladimir Volodko
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_FBUFFER_HPP
#define MSGPACK_FBUFFER_HPP
#include "msgpack/fbuffer_decl.hpp"
#include "msgpack/v1/fbuffer.hpp"
#endif // MSGPACK_FBUFFER_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ FILE* buffer adaptor
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_FBUFFER_DECL_HPP
#define MSGPACK_FBUFFER_DECL_HPP
#include "msgpack/v1/fbuffer_decl.hpp"
#include "msgpack/v2/fbuffer_decl.hpp"
#include "msgpack/v3/fbuffer_decl.hpp"
#endif // MSGPACK_FBUFFER_DECL_HPP

View File

@@ -0,0 +1,30 @@
//
// MessagePack for C++ old gcc workaround for atomic operation
//
// Copyright (C) 2008-2013 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_GCC_ATOMIC_HPP
#define MSGPACK_GCC_ATOMIC_HPP
#if defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41)
#include <bits/atomicity.h>
int _msgpack_sync_decr_and_fetch(volatile _msgpack_atomic_counter_t* ptr)
{
return __gnu_cxx::__exchange_and_add(ptr, -1) - 1;
}
int _msgpack_sync_incr_and_fetch(volatile _msgpack_atomic_counter_t* ptr)
{
return __gnu_cxx::__exchange_and_add(ptr, 1) + 1;
}
#endif // old gcc workaround
#endif /* gcc_atomic.hpp */

View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015-2016 MIZUKI Hirata
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_ITERATOR_HPP
#define MSGPACK_ITERATOR_HPP
#include <msgpack/iterator_decl.hpp>
#include <msgpack/v1/iterator.hpp>
#endif // MSGPACK_ITERATOR_HPP

View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_ITERATOR_DECL_HPP
#define MSGPACK_ITERATOR_DECL_HPP
#include <msgpack/v1/iterator_decl.hpp>
#include <msgpack/v2/iterator_decl.hpp>
#include <msgpack/v3/iterator_decl.hpp>
#endif // MSGPACK_ITERATOR_DECL_HPP

18
extern/msgpack/include/msgpack/meta.hpp vendored Normal file
View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015-2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_META_HPP
#define MSGPACK_META_HPP
#include "msgpack/meta_decl.hpp"
#include "msgpack/v1/meta.hpp"
#endif // MSGPACK_META_HPP

View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015-2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_META_DECL_HPP
#define MSGPACK_META_DECL_HPP
#include "msgpack/v1/meta_decl.hpp"
#include "msgpack/v2/meta_decl.hpp"
#include "msgpack/v3/meta_decl.hpp"
#endif // MSGPACK_META_DECL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_NULL_VISITOR_HPP
#define MSGPACK_NULL_VISITOR_HPP
#include "msgpack/null_visitor_decl.hpp"
#include "msgpack/v2/null_visitor.hpp"
#endif // MSGPACK_NULL_VISITOR_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_NULL_VISITOR_DECL_HPP
#define MSGPACK_NULL_VISITOR_DECL_HPP
#include "msgpack/v2/null_visitor_decl.hpp"
#include "msgpack/v3/null_visitor_decl.hpp"
#endif // MSGPACK_NULL_VISITOR_DECL_HPP

View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_OBJECT_HPP
#define MSGPACK_OBJECT_HPP
#include "msgpack/object_decl.hpp"
#include "msgpack/v1/object.hpp"
#include "msgpack/v2/object.hpp"
#endif // MSGPACK_OBJECT_HPP

View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_OBJECT_DECL_HPP
#define MSGPACK_OBJECT_DECL_HPP
#include "msgpack/v1/object_decl.hpp"
#include "msgpack/v2/object_decl.hpp"
#include "msgpack/v3/object_decl.hpp"
#endif // MSGPACK_OBJECT_DECL_HPP

View File

@@ -0,0 +1,20 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_OBJECT_FWD_HPP
#define MSGPACK_OBJECT_FWD_HPP
#include "msgpack/object_fwd_decl.hpp"
#include "msgpack/v1/object_fwd.hpp"
#include "msgpack/v2/object_fwd.hpp"
#include "msgpack/v3/object_fwd.hpp"
#endif // MSGPACK_OBJECT_FWD_HPP

View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_OBJECT_FWD_DECL_HPP
#define MSGPACK_OBJECT_FWD_DECL_HPP
#include "msgpack/v1/object_fwd_decl.hpp"
#include "msgpack/v2/object_fwd_decl.hpp"
#include "msgpack/v3/object_fwd_decl.hpp"
#endif // MSGPACK_OBJECT_FWD_DECL_HPP

17
extern/msgpack/include/msgpack/pack.hpp vendored Normal file
View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ serializing routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_PACK_HPP
#define MSGPACK_PACK_HPP
#include "msgpack/pack_decl.hpp"
#include "msgpack/v1/pack.hpp"
#endif // MSGPACK_PACK_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ serializing routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_PACK_DECL_HPP
#define MSGPACK_PACK_DECL_HPP
#include "msgpack/v1/pack_decl.hpp"
#include "msgpack/v2/pack_decl.hpp"
#include "msgpack/v3/pack_decl.hpp"
#endif // MSGPACK_PACK_DECL_HPP

View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_PARSE_HPP
#define MSGPACK_PARSE_HPP
#include "msgpack/parse_decl.hpp"
#include "msgpack/v2/parse.hpp"
#include "msgpack/v3/parse.hpp"
#endif // MSGPACK_PARSE_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_PARSE_DECL_HPP
#define MSGPACK_PARSE_DECL_HPP
#include "msgpack/v2/parse_decl.hpp"
#include "msgpack/v3/parse_decl.hpp"
#endif // MSGPACK_PARSE_DECL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2017 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_PARSE_RETURN_HPP
#define MSGPACK_PARSE_RETURN_HPP
#include "msgpack/v1/parse_return.hpp"
#include "msgpack/v2/parse_return.hpp"
#include "msgpack/v3/parse_return.hpp"
#endif // MSGPACK_PARSE_RETURN_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ simple buffer implementation
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_SBUFFER_HPP
#define MSGPACK_SBUFFER_HPP
#include "msgpack/sbuffer_decl.hpp"
#include "msgpack/v1/sbuffer.hpp"
#endif // MSGPACK_SBUFFER_HPP

View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ simple buffer implementation
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_SBUFFER_DECL_HPP
#define MSGPACK_SBUFFER_DECL_HPP
#include "msgpack/v1/sbuffer_decl.hpp"
#include "msgpack/v2/sbuffer_decl.hpp"
#include "msgpack/v3/sbuffer_decl.hpp"
#endif // MSGPACK_SBUFFER_DECL_HPP

View File

@@ -0,0 +1,191 @@
/*
* MessagePack system dependencies
*
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef MSGPACK_SYSDEP_HPP
#define MSGPACK_SYSDEP_HPP
#include <stdlib.h>
#include <stddef.h>
#if defined(_MSC_VER) && _MSC_VER <= 1800
# define snprintf(buf, len, format,...) _snprintf_s(buf, len, _TRUNCATE, format, __VA_ARGS__)
#endif
#if defined(_MSC_VER) && _MSC_VER < 1600
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#elif defined(_MSC_VER) // && _MSC_VER >= 1600
# include <stdint.h>
#else
# include <stdint.h>
# include <stdbool.h>
#endif
#if !defined(MSGPACK_DLLEXPORT)
#if defined(_MSC_VER)
# define MSGPACK_DLLEXPORT __declspec(dllexport)
#else /* _MSC_VER */
# define MSGPACK_DLLEXPORT
#endif /* _MSC_VER */
#endif
#ifdef _WIN32
# if defined(_KERNEL_MODE)
# define _msgpack_atomic_counter_header <ntddk.h>
# else
# define _msgpack_atomic_counter_header <windows.h>
# if !defined(WIN32_LEAN_AND_MEAN)
# define WIN32_LEAN_AND_MEAN
# endif /* WIN32_LEAN_AND_MEAN */
# endif
typedef long _msgpack_atomic_counter_t;
#if defined(_AMD64_) || defined(_M_X64) || defined(_M_ARM64)
# define _msgpack_sync_decr_and_fetch(ptr) _InterlockedDecrement(ptr)
# define _msgpack_sync_incr_and_fetch(ptr) _InterlockedIncrement(ptr)
#else
# define _msgpack_sync_decr_and_fetch(ptr) InterlockedDecrement(ptr)
# define _msgpack_sync_incr_and_fetch(ptr) InterlockedIncrement(ptr)
#endif
#elif defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41)
# define _msgpack_atomic_counter_header "msgpack/gcc_atomic.hpp"
#else
typedef unsigned int _msgpack_atomic_counter_t;
# define _msgpack_sync_decr_and_fetch(ptr) __sync_sub_and_fetch(ptr, 1)
# define _msgpack_sync_incr_and_fetch(ptr) __sync_add_and_fetch(ptr, 1)
#endif
#ifdef _WIN32
/* numeric_limits<T>::min,max */
# ifdef max
# undef max
# endif
# ifdef min
# undef min
# endif
#elif defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__)
#include <arpa/inet.h> /* __BYTE_ORDER */
# if defined(linux)
# include <byteswap.h>
# endif
#endif
#if !defined(MSGPACK_ENDIAN_LITTLE_BYTE) && !defined(MSGPACK_ENDIAN_BIG_BYTE)
#include <boost/predef/other/endian.h>
#define MSGPACK_ENDIAN_LITTLE_BYTE BOOST_ENDIAN_LITTLE_BYTE
#define MSGPACK_ENDIAN_BIG_BYTE BOOST_ENDIAN_BIG_BYTE
#endif // !defined(MSGPACK_ENDIAN_LITTLE_BYTE) && !defined(MSGPACK_ENDIAN_BIG_BYTE)
#if MSGPACK_ENDIAN_LITTLE_BYTE
# if defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__)
# define _msgpack_be16(x) ntohs((uint16_t)x)
# else
# if defined(ntohs)
# define _msgpack_be16(x) ntohs(x)
# elif defined(_byteswap_ushort) || (defined(_MSC_VER) && _MSC_VER >= 1400)
# define _msgpack_be16(x) ((uint16_t)_byteswap_ushort((unsigned short)x))
# else
# define _msgpack_be16(x) ( \
((((uint16_t)x) << 8) ) | \
((((uint16_t)x) >> 8) ) )
# endif
# endif
# if defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__)
# define _msgpack_be32(x) ntohl((uint32_t)x)
# else
# if defined(ntohl)
# define _msgpack_be32(x) ntohl(x)
# elif defined(_byteswap_ulong) || (defined(_MSC_VER) && _MSC_VER >= 1400)
# define _msgpack_be32(x) ((uint32_t)_byteswap_ulong((unsigned long)x))
# else
# define _msgpack_be32(x) \
( ((((uint32_t)x) << 24) ) | \
((((uint32_t)x) << 8) & 0x00ff0000U ) | \
((((uint32_t)x) >> 8) & 0x0000ff00U ) | \
((((uint32_t)x) >> 24) ) )
# endif
# endif
# if defined(_byteswap_uint64) || (defined(_MSC_VER) && _MSC_VER >= 1400)
# define _msgpack_be64(x) (_byteswap_uint64(x))
# elif defined(bswap_64)
# define _msgpack_be64(x) bswap_64(x)
# elif defined(__DARWIN_OSSwapInt64)
# define _msgpack_be64(x) __DARWIN_OSSwapInt64(x)
# else
# define _msgpack_be64(x) \
( ((((uint64_t)x) << 56) ) | \
((((uint64_t)x) << 40) & 0x00ff000000000000ULL ) | \
((((uint64_t)x) << 24) & 0x0000ff0000000000ULL ) | \
((((uint64_t)x) << 8) & 0x000000ff00000000ULL ) | \
((((uint64_t)x) >> 8) & 0x00000000ff000000ULL ) | \
((((uint64_t)x) >> 24) & 0x0000000000ff0000ULL ) | \
((((uint64_t)x) >> 40) & 0x000000000000ff00ULL ) | \
((((uint64_t)x) >> 56) ) )
# endif
#elif MSGPACK_ENDIAN_BIG_BYTE
# define _msgpack_be16(x) (x)
# define _msgpack_be32(x) (x)
# define _msgpack_be64(x) (x)
#else
# error msgpack-c supports only big endian and little endian
#endif /* MSGPACK_ENDIAN_LITTLE_BYTE */
#define _msgpack_load16(cast, from, to) do { \
memcpy((cast*)(to), (from), sizeof(cast)); \
*(to) = (cast)_msgpack_be16(*(to)); \
} while (0);
#define _msgpack_load32(cast, from, to) do { \
memcpy((cast*)(to), (from), sizeof(cast)); \
*(to) = (cast)_msgpack_be32(*(to)); \
} while (0);
#define _msgpack_load64(cast, from, to) do { \
memcpy((cast*)(to), (from), sizeof(cast)); \
*(to) = (cast)_msgpack_be64(*(to)); \
} while (0);
#define _msgpack_store16(to, num) \
do { uint16_t val = _msgpack_be16(num); memcpy(to, &val, 2); } while(0)
#define _msgpack_store32(to, num) \
do { uint32_t val = _msgpack_be32(num); memcpy(to, &val, 4); } while(0)
#define _msgpack_store64(to, num) \
do { uint64_t val = _msgpack_be64(num); memcpy(to, &val, 8); } while(0)
/*
#define _msgpack_load16(cast, from) \
({ cast val; memcpy(&val, (char*)from, 2); _msgpack_be16(val); })
#define _msgpack_load32(cast, from) \
({ cast val; memcpy(&val, (char*)from, 4); _msgpack_be32(val); })
#define _msgpack_load64(cast, from) \
({ cast val; memcpy(&val, (char*)from, 8); _msgpack_be64(val); })
*/
#ifdef __APPLE__
# include <TargetConditionals.h>
#endif
#endif /* msgpack/sysdep.hpp */

67
extern/msgpack/include/msgpack/type.hpp vendored Normal file
View File

@@ -0,0 +1,67 @@
#include "cpp_config.hpp"
#include "adaptor/array_ref.hpp"
#include "adaptor/bool.hpp"
#include "adaptor/carray.hpp"
#include "adaptor/char_ptr.hpp"
#include "adaptor/deque.hpp"
#include "adaptor/ext.hpp"
#include "adaptor/fixint.hpp"
#include "adaptor/float.hpp"
#include "adaptor/int.hpp"
#include "adaptor/complex.hpp"
#include "adaptor/list.hpp"
#include "adaptor/map.hpp"
#include "adaptor/nil.hpp"
#include "adaptor/pair.hpp"
#include "adaptor/raw.hpp"
#include "adaptor/v4raw.hpp"
#include "adaptor/set.hpp"
#include "adaptor/size_equal_only.hpp"
#include "adaptor/string.hpp"
#include "adaptor/vector.hpp"
#include "adaptor/vector_bool.hpp"
#include "adaptor/vector_char.hpp"
#include "adaptor/vector_unsigned_char.hpp"
#include "adaptor/wstring.hpp"
#include "adaptor/msgpack_tuple.hpp"
#include "adaptor/define.hpp"
#if defined(MSGPACK_USE_CPP03)
#include "adaptor/tr1/unordered_map.hpp"
#include "adaptor/tr1/unordered_set.hpp"
#else // defined(MSGPACK_USE_CPP03)
#include "adaptor/cpp11/array.hpp"
#include "adaptor/cpp11/array_char.hpp"
#include "adaptor/cpp11/array_unsigned_char.hpp"
#include "adaptor/cpp11/chrono.hpp"
#include "adaptor/cpp11/forward_list.hpp"
#include "adaptor/cpp11/reference_wrapper.hpp"
#include "adaptor/cpp11/shared_ptr.hpp"
#include "adaptor/cpp11/timespec.hpp"
#include "adaptor/cpp11/tuple.hpp"
#include "adaptor/cpp11/unique_ptr.hpp"
#include "adaptor/cpp11/unordered_map.hpp"
#include "adaptor/cpp11/unordered_set.hpp"
#if MSGPACK_HAS_INCLUDE(<optional>)
#include "adaptor/cpp17/optional.hpp"
#endif // MSGPACK_HAS_INCLUDE(<optional>)
#if MSGPACK_HAS_INCLUDE(<string_view>)
#include "adaptor/cpp17/string_view.hpp"
#endif // MSGPACK_HAS_INCLUDE(<string_view>)
#include "adaptor/cpp17/byte.hpp"
#include "adaptor/cpp17/carray_byte.hpp"
#include "adaptor/cpp17/vector_byte.hpp"
#endif // defined(MSGPACK_USE_CPP03)
#include "adaptor/boost/fusion.hpp"
#include "adaptor/boost/msgpack_variant.hpp"
#include "adaptor/boost/optional.hpp"
#include "adaptor/boost/string_ref.hpp"
#include "adaptor/boost/string_view.hpp"

View File

@@ -0,0 +1,19 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_UNPACK_HPP
#define MSGPACK_UNPACK_HPP
#include "msgpack/unpack_decl.hpp"
#include "msgpack/v1/unpack.hpp"
#include "msgpack/v2/unpack.hpp"
#include "msgpack/v3/unpack.hpp"
#endif // MSGPACK_UNPACK_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_UNPACK_DECL_HPP
#define MSGPACK_UNPACK_DECL_HPP
#include "msgpack/v1/unpack_decl.hpp"
#include "msgpack/v2/unpack_decl.hpp"
#include "msgpack/v3/unpack_decl.hpp"
#endif // MSGPACK_UNPACK_DECL_HPP

View File

@@ -0,0 +1,75 @@
/*
* MessagePack unpacking routine template
*
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef MSGPACK_UNPACK_DEFINE_HPP
#define MSGPACK_UNPACK_DEFINE_HPP
#include "msgpack/sysdep.hpp"
#ifndef MSGPACK_EMBED_STACK_SIZE
#define MSGPACK_EMBED_STACK_SIZE 32
#endif
typedef enum {
MSGPACK_CS_HEADER = 0x00, // nil
//MSGPACK_CS_ = 0x01,
//MSGPACK_CS_ = 0x02, // false
//MSGPACK_CS_ = 0x03, // true
MSGPACK_CS_BIN_8 = 0x04,
MSGPACK_CS_BIN_16 = 0x05,
MSGPACK_CS_BIN_32 = 0x06,
MSGPACK_CS_EXT_8 = 0x07,
MSGPACK_CS_EXT_16 = 0x08,
MSGPACK_CS_EXT_32 = 0x09,
MSGPACK_CS_FLOAT = 0x0a,
MSGPACK_CS_DOUBLE = 0x0b,
MSGPACK_CS_UINT_8 = 0x0c,
MSGPACK_CS_UINT_16 = 0x0d,
MSGPACK_CS_UINT_32 = 0x0e,
MSGPACK_CS_UINT_64 = 0x0f,
MSGPACK_CS_INT_8 = 0x10,
MSGPACK_CS_INT_16 = 0x11,
MSGPACK_CS_INT_32 = 0x12,
MSGPACK_CS_INT_64 = 0x13,
MSGPACK_CS_FIXEXT_1 = 0x14,
MSGPACK_CS_FIXEXT_2 = 0x15,
MSGPACK_CS_FIXEXT_4 = 0x16,
MSGPACK_CS_FIXEXT_8 = 0x17,
MSGPACK_CS_FIXEXT_16 = 0x18,
MSGPACK_CS_STR_8 = 0x19, // str8
MSGPACK_CS_STR_16 = 0x1a, // str16
MSGPACK_CS_STR_32 = 0x1b, // str32
MSGPACK_CS_ARRAY_16 = 0x1c,
MSGPACK_CS_ARRAY_32 = 0x1d,
MSGPACK_CS_MAP_16 = 0x1e,
MSGPACK_CS_MAP_32 = 0x1f,
//MSGPACK_ACS_BIG_INT_VALUE,
//MSGPACK_ACS_BIG_FLOAT_VALUE,
MSGPACK_ACS_STR_VALUE,
MSGPACK_ACS_BIN_VALUE,
MSGPACK_ACS_EXT_VALUE
} msgpack_unpack_state;
typedef enum {
MSGPACK_CT_ARRAY_ITEM,
MSGPACK_CT_MAP_KEY,
MSGPACK_CT_MAP_VALUE
} msgpack_container_type;
#endif /* msgpack/unpack_define.hpp */

View File

@@ -0,0 +1,15 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2017 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_UNPACK_EXCEPTION_HPP
#define MSGPACK_UNPACK_EXCEPTION_HPP
#include "msgpack/v1/unpack_exception.hpp"
#endif // MSGPACK_UNPACK_EXCEPTION_HPP

View File

@@ -0,0 +1,116 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015-2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_V1_ADAPTOR_BASE_HPP
#define MSGPACK_V1_ADAPTOR_BASE_HPP
#include "msgpack/v1/adaptor/adaptor_base_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v1) {
/// @endcond
namespace adaptor {
// Adaptor functors
template <typename T, typename Enabler>
struct convert {
msgpack::object const& operator()(msgpack::object const& o, T& v) const;
};
template <typename T, typename Enabler>
struct pack {
template <typename Stream>
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, T const& v) const;
};
template <typename T, typename Enabler>
struct object {
void operator()(msgpack::object& o, T const& v) const;
};
template <typename T, typename Enabler>
struct object_with_zone {
void operator()(msgpack::object::with_zone& o, T const& v) const;
};
} // namespace adaptor
// operators
template <typename T>
inline
typename msgpack::enable_if<
!is_array<T>::value,
msgpack::object const&
>::type
operator>> (msgpack::object const& o, T& v) {
return msgpack::adaptor::convert<T>()(o, v);
}
template <typename T, std::size_t N>
inline
msgpack::object const& operator>> (msgpack::object const& o, T(&v)[N]) {
return msgpack::adaptor::convert<T[N]>()(o, v);
}
template <typename Stream, typename T>
inline
typename msgpack::enable_if<
!is_array<T>::value,
msgpack::packer<Stream>&
>::type
operator<< (msgpack::packer<Stream>& o, T const& v) {
return msgpack::adaptor::pack<T>()(o, v);
}
template <typename Stream, typename T, std::size_t N>
inline
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const T(&v)[N]) {
return msgpack::adaptor::pack<T[N]>()(o, v);
}
template <typename T>
inline
typename msgpack::enable_if<
!is_array<T>::value
>::type
operator<< (msgpack::object& o, T const& v) {
msgpack::adaptor::object<T>()(o, v);
}
template <typename T, std::size_t N>
inline
void operator<< (msgpack::v1::object& o, const T(&v)[N]) {
msgpack::v1::adaptor::object<T[N]>()(o, v);
}
template <typename T>
inline
typename msgpack::enable_if<
!is_array<T>::value
>::type
operator<< (msgpack::object::with_zone& o, T const& v) {
msgpack::adaptor::object_with_zone<T>()(o, v);
}
template <typename T, std::size_t N>
inline
void operator<< (msgpack::object::with_zone& o, const T(&v)[N]) {
msgpack::adaptor::object_with_zone<T[N]>()(o, v);
}
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v1)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V1_ADAPTOR_BASE_HPP

View File

@@ -0,0 +1,86 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_V1_ADAPTOR_BASE_DECL_HPP
#define MSGPACK_V1_ADAPTOR_BASE_DECL_HPP
#include "msgpack/versioning.hpp"
#include "msgpack/object_fwd.hpp"
#include "msgpack/pack.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v1) {
/// @endcond
template <typename Stream>
class packer;
namespace adaptor {
// Adaptor functors
template <typename T, typename Enabler = void>
struct convert;
template <typename T, typename Enabler = void>
struct pack;
template <typename T, typename Enabler = void>
struct object;
template <typename T, typename Enabler = void>
struct object_with_zone;
} // namespace adaptor
// operators
template <typename T>
typename msgpack::enable_if<
!is_array<T>::value,
msgpack::object const&
>::type
operator>> (msgpack::object const& o, T& v);
template <typename T, std::size_t N>
msgpack::object const& operator>> (msgpack::object const& o, T(&v)[N]);
template <typename Stream, typename T>
typename msgpack::enable_if<
!is_array<T>::value,
msgpack::packer<Stream>&
>::type
operator<< (msgpack::packer<Stream>& o, T const& v);
template <typename Stream, typename T, std::size_t N>
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const T(&v)[N]);
template <typename T>
typename msgpack::enable_if<
!is_array<T>::value
>::type
operator<< (msgpack::object& o, T const& v);
template <typename T, std::size_t N>
void operator<< (msgpack::object& o, const T(&v)[N]);
template <typename T>
typename msgpack::enable_if<
!is_array<T>::value
>::type
operator<< (msgpack::object::with_zone& o, T const& v);
template <typename T, std::size_t N>
void operator<< (msgpack::object::with_zone& o, const T(&v)[N]);
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v1)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V1_ADAPTOR_BASE_DECL_HPP

Some files were not shown because too many files have changed in this diff Show More