Support attribute "cpp_ptr_type" on table elements marked as "hash" (#4643)
* added intended use-cases to monster_test.fbs * added check for `cpp_ptr_type` on hashed fields added default value 'naked' to `cpp_ptr_type` on hashed fields * added C++ generation of cpp_type vectors removed ctor call for vector fields added condition !vector for cpp_type check added Pack() and UnPack() code generation for vector of hashes added generation of correct resolve/rehash for cpp_type elements * added attribute 'cpp_ptr_type_get' to hold accessor for pointer types possible where '.get()' does not work use case: cpp_ptr_type:"std::weak_ptr", cpp_ptr_type_get:".lock().get()" * run flatc to re-generate headers * added bool param is_ctor to GetDefaultScalarValue() to differentiate between usage places * modified monster_test.fbs to remove usage of shared_ptr/weak_ptr reason: STLport does not support std::shared_ptr and std::weak_ptr * run flatc again to re-generate headers * fixed symbol unique_ptr not in namespace std when building with STLport
Showing
- include/flatbuffers/idl.h 1 addition, 0 deletionsinclude/flatbuffers/idl.h
- src/idl_gen_cpp.cpp 43 additions, 13 deletionssrc/idl_gen_cpp.cpp
- src/idl_parser.cpp 8 additions, 0 deletionssrc/idl_parser.cpp
- tests/MyGame/Example/Monster.cs 27 additions, 1 deletiontests/MyGame/Example/Monster.cs
- tests/MyGame/Example/Monster.go 103 additions, 1 deletiontests/MyGame/Example/Monster.go
- tests/MyGame/Example/Monster.java 30 additions, 1 deletiontests/MyGame/Example/Monster.java
- tests/MyGame/Example/Monster.php 205 additions, 3 deletionstests/MyGame/Example/Monster.php
- tests/MyGame/Example/Monster.py 87 additions, 1 deletiontests/MyGame/Example/Monster.py
- tests/monster_test.bfbs 0 additions, 0 deletionstests/monster_test.bfbs
- tests/monster_test.fbs 5 additions, 0 deletionstests/monster_test.fbs
- tests/monster_test.schema.json 6 additions, 1 deletiontests/monster_test.schema.json
- tests/monster_test_generated.h 136 additions, 41 deletionstests/monster_test_generated.h
- tests/monster_test_generated.js 202 additions, 1 deletiontests/monster_test_generated.js
- tests/monster_test_generated.ts 202 additions, 1 deletiontests/monster_test_generated.ts
- tests/namespace_test/namespace_test2_generated.ts 10 additions, 10 deletionstests/namespace_test/namespace_test2_generated.ts
- tests/test.cpp 9 additions, 0 deletionstests/test.cpp
Loading
Please register or sign in to comment