Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-07-23BLI: move some tests into blenlib/testsJacques Lucke
Reviewers: sybren Differential Revision: https://developer.blender.org/D8315
2020-07-20Refactor: Update integer type usageJacques Lucke
This updates the usage of integer types in code I wrote according to our new style guides. Major changes: * Use signed instead of unsigned integers in many places. * C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`). * Hash values for C++ containers are 64 bit wide now (instead of 32 bit). I do hope that I broke no builds, but it is quite likely that some compiler reports slightly different errors. Please let me know when there are any errors. If the fix is small, feel free to commit it yourself. I compiled successfully on linux with gcc and on windows.
2020-07-08Cleanup: add correct license header to testsJacques Lucke
2020-06-30Fix compile errorJacques Lucke
This is the same issue as in rBbcf49d13e53454.
2020-06-30Cleanup: move tests into their corresponding namespaceJacques Lucke
2020-06-29BLI: remove blender::Optional in favor of std::optionalJacques Lucke
`std::optional` can be used now, because we switched to C++17.
2020-06-19Tests: Use explicit signature constantsSergey Sharybin
Are reported by MSVC 2019 after C++17 switch. One might suggest lets just silence the warning, I will say why to have specific signed/unsigned types in API just to then (usafely) ignore the sign conversion.
2020-06-16BLI: fix Map.foreach_item methodJacques Lucke
2020-06-11BLI: define default hash function for const typesJacques Lucke
2020-06-11BLI: make Map::Item and Map::MutableItem more accessibleJacques Lucke
This makes it easier to write range-for loops over all items in the map without using auto.
2020-06-10BLI: add Map.pop_default methodJacques Lucke
There is a nice use case for this in depsgraph code. Also I added some previously missing calls to std::move.
2020-06-10BLI: add Map.pop_try methodJacques Lucke
I found this pattern in depsgraph code more than once.
2020-06-10BLI: update behavior of Map.lookup_or_addJacques Lucke
Previously, this function would expect a callback function as parameter. This behavior is now in Map.lookup_or_add_cb. The new version just takes the key and value directly.
2020-06-09BLI: put C++ data structures in "blender" namespace instead of "BLI"Jacques Lucke
We plan to use the "blender" namespace in other modules as well.
2020-06-09BLI: generally improve C++ data structuresJacques Lucke
The main focus here was to improve the docs significantly. Furthermore, I reimplemented `Set`, `Map` and `VectorSet`. They are now (usually) faster, simpler and more customizable. I also rewrote `Stack` to make it more efficient by avoiding unnecessary copies. Thanks to everyone who helped with constructive feedback. Approved by brecht and sybren. Differential Revision: https://developer.blender.org/D7931
2020-04-28BLI: add Map.lookup_or_add_default methodJacques Lucke
2020-04-28BLI: add Map.is_empty() methodJacques Lucke
2020-04-21BLI: Use .hh extension for C++ headers in blenlibJacques Lucke
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2019-10-20Cleanup: missing declaration warningsCampbell Barton
2019-09-14BLI: make Map.add_or_modify more powerfulJacques Lucke
The function now allows custom return types defined by the callbacks. This can be useful when a user of the data structure has to implement some custom behavior.
2019-09-14BLI: Improve forwarding semantics of some data structuresJacques Lucke
This makes it possible to use e.g. `std::unique_ptr` in a map.
2019-09-13BLI: add some missing methods to Map and SetVectorJacques Lucke
2019-09-13BLI: new C++ hash table data structuresJacques Lucke
This commit adds some new hashing based data structures to blenlib. All of them use open addressing with probing currently. Furthermore, they support small object optimization, but it is not customizable yet. I'll add support for this when necessary. The following main data structures are included: **Set** A collection of values, where every value must exist at most once. This is similar to a Python `set`. **SetVector** A combination of a Set and a Vector. It supports fast search for elements and maintains insertion order when there are no deletes. All elements are stored in a continuous array. So they can be iterated over using a normal `ArrayRef`. **Map** A set of key-value-pairs, where every key must exist at most once. This is similar to a Python `dict`. **StringMap** A special map for the case when the keys are strings. This case is fairly common and allows for some optimizations. Most importantly, many unnecessary allocations can be avoided by storing strings in a single buffer. Furthermore, the interface of this class uses `StringRef` to avoid unnecessary conversions. This commit is a continuation of rB369d5e8ad2bb7.