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
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2021-07-30Cleanup: clang-format (re-run after v12 version bump)Campbell Barton
2021-05-13BLI: support looking up a key stored in Map or VectorSetJacques Lucke
Sometimes it is useful to find the key that compares equal to a known key. Typically that happens when the key itself has additional data attached that is not part of its hash. Note that the returned key reference/pointer is const, because the caller must not change the key in a way that changes its hash or how it compares to other keys.
2021-04-30BLI: support removing Map elements during iterationJacques Lucke
While it was technically safe to call Map.remove while iterating over a map, it wasn't really designed to work. Also it wasn't very efficient, because to remove the element, the map would have to search it again. Now it is possible to remove an element given an iterator into the map. It is safe to remove the element while iterating over the map. Obviously, the removed element must not be accessed anymore after it has been removed.
2021-04-30BLI: add a common base class for Map iteratorsJacques Lucke
This is useful for an upcoming commit that allows removing an element based on an iterator.
2021-04-17BLI: support multiple arguments for value in *_as methods of MapJacques Lucke
This allows us to build more complex values in-place in the map. Before those values had to be build separately and then moved into the map. Existing calls to the Map API remain unchanged.
2021-03-20BLI: improve support for generic algorithms with c++ containersJacques Lucke
Some generic algorithms from the standard library like `std::any_of` did not work with all container and iterator types. To improve the situation, this patch adds various type members to containers and iterators. Custom iterators for Set, Map and IndexRange now have an iterator category, which soe algorithms require. IndexRange could become a random access iterator, but adding all the missing methods can be done when it is necessary.
2020-10-29BLI: use forwarding reference in MapJacques Lucke
The is necessary when Map.add_or_modify is called with callbacks that return a reference.
2020-10-28BLI: improve Map.add_newJacques Lucke
Now it is possible to use Map.add_new_as which supports different types for the key and value.
2020-08-24BLI: simplify lookup methods in MapJacques Lucke
No functional changes expected.
2020-08-24BLI: improve exception safety of Set and MapJacques Lucke
For more information see rB2aff45146f1464ba8899368ad004522cb6a1a98c.
2020-08-07Cleanup: use C++ style casts in various placesJacques Lucke
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-07-20BLI: add typedefs for containers that use raw allocatorsJacques Lucke
Those are useful when you have to create containers with static storage duration. If those would use Blender's guarded allocator, it would report memory leaks, that are not actually leaks.
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: use c++17 helper variable templatesJacques Lucke
2020-07-07Cleanup: remove redundant commentsJacques Lucke
Searching in these files for "_as" will reveal a comment at the top, that explains what these methods are for. There is no need to duplicate that knowledge all over the place.
2020-07-03Cleanup: Use trailing underscore for non-public data membersJacques Lucke
This makes the code conform better with our style guide.
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-25Cleanup: spellingCampbell Barton
2020-06-16BLI: fix Map.foreach_item methodJacques Lucke
2020-06-13Cleanup: spellingCampbell Barton
2020-06-11BLI: fix forwarding with incorrect typeJacques Lucke
2020-06-11BLI: don't pass const pointers to placement new operatorJacques Lucke
This resulted in compile errors.
2020-06-11BLI: fix printing name in print_stats methods of Map, Set and VectorSetJacques 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: fix type forwarding in MapJacques Lucke
Without this change, the code might do an unwanted conversion.
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-24BLI: Implement StringMap.add and StringMap.add_or_modifyJacques Lucke
2020-04-23BLI: various data structure improvementsJacques Lucke
* Rename template parameter N to InlineBufferCapacity * Expose InlineBufferCapacity parameter for Set and Map * Add some comments * Fixed an error that I introduced recently
2020-04-21BLI: Use .hh extension for C++ headers in blenlibJacques Lucke