diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/alignment_test_generated.h | 16 | ||||
-rw-r--r-- | tests/arrays_test_generated.h | 12 | ||||
-rw-r--r-- | tests/monster_extra_generated.h | 8 | ||||
-rw-r--r-- | tests/monster_test_generated.h | 50 | ||||
-rw-r--r-- | tests/monster_test_suffix/ext_only/monster_test_generated.hpp | 50 | ||||
-rw-r--r-- | tests/monster_test_suffix/filesuffix_only/monster_test_suffix.h | 50 | ||||
-rw-r--r-- | tests/monster_test_suffix/monster_test_suffix.hpp | 50 | ||||
-rw-r--r-- | tests/namespace_test/namespace_test2_generated.h | 20 | ||||
-rw-r--r-- | tests/native_inline_table_test_generated.h | 2 | ||||
-rw-r--r-- | tests/native_type_test_generated.h | 8 | ||||
-rw-r--r-- | tests/optional_scalars_generated.h | 8 | ||||
-rw-r--r-- | tests/union_vector/union_vector_generated.h | 8 |
12 files changed, 141 insertions, 141 deletions
diff --git a/tests/alignment_test_generated.h b/tests/alignment_test_generated.h index 0c61c8fe..71421cac 100644 --- a/tests/alignment_test_generated.h +++ b/tests/alignment_test_generated.h @@ -130,7 +130,7 @@ inline bool operator!=(const BadAlignmentLarge &lhs, const BadAlignmentLarge &rh struct OuterLargeT : public ::flatbuffers::NativeTable { typedef OuterLarge TableType; - flatbuffers::unique_ptr<BadAlignmentLarge> large{}; + std::unique_ptr<BadAlignmentLarge> large{}; OuterLargeT() = default; OuterLargeT(const OuterLargeT &o); OuterLargeT(OuterLargeT&&) FLATBUFFERS_NOEXCEPT = default; @@ -192,7 +192,7 @@ inline ::flatbuffers::Offset<OuterLarge> CreateOuterLarge( struct BadAlignmentRootT : public ::flatbuffers::NativeTable { typedef BadAlignmentRoot TableType; - flatbuffers::unique_ptr<OuterLargeT> large{}; + std::unique_ptr<OuterLargeT> large{}; std::vector<BadAlignmentSmall> small{}; BadAlignmentRootT() = default; BadAlignmentRootT(const BadAlignmentRootT &o); @@ -308,7 +308,7 @@ inline OuterLargeT *OuterLarge::UnPack(const ::flatbuffers::resolver_function_t inline void OuterLarge::UnPackTo(OuterLargeT *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = large(); if (_e) _o->large = flatbuffers::unique_ptr<BadAlignmentLarge>(new BadAlignmentLarge(*_e)); } + { auto _e = large(); if (_e) _o->large = std::unique_ptr<BadAlignmentLarge>(new BadAlignmentLarge(*_e)); } } inline ::flatbuffers::Offset<OuterLarge> OuterLarge::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const OuterLargeT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) { @@ -357,7 +357,7 @@ inline BadAlignmentRootT *BadAlignmentRoot::UnPack(const ::flatbuffers::resolver inline void BadAlignmentRoot::UnPackTo(BadAlignmentRootT *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = large(); if (_e) { if(_o->large) { _e->UnPackTo(_o->large.get(), _resolver); } else { _o->large = flatbuffers::unique_ptr<OuterLargeT>(_e->UnPack(_resolver)); } } else if (_o->large) { _o->large.reset(); } } + { auto _e = large(); if (_e) { if(_o->large) { _e->UnPackTo(_o->large.get(), _resolver); } else { _o->large = std::unique_ptr<OuterLargeT>(_e->UnPack(_resolver)); } } else if (_o->large) { _o->large.reset(); } } { auto _e = small(); if (_e) { _o->small.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->small[_i] = *_e->Get(_i); } } else { _o->small.resize(0); } } } @@ -482,16 +482,16 @@ inline void FinishSizePrefixedBadAlignmentRootBuffer( fbb.FinishSizePrefixed(root); } -inline flatbuffers::unique_ptr<BadAlignmentRootT> UnPackBadAlignmentRoot( +inline std::unique_ptr<BadAlignmentRootT> UnPackBadAlignmentRoot( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<BadAlignmentRootT>(GetBadAlignmentRoot(buf)->UnPack(res)); + return std::unique_ptr<BadAlignmentRootT>(GetBadAlignmentRoot(buf)->UnPack(res)); } -inline flatbuffers::unique_ptr<BadAlignmentRootT> UnPackSizePrefixedBadAlignmentRoot( +inline std::unique_ptr<BadAlignmentRootT> UnPackSizePrefixedBadAlignmentRoot( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<BadAlignmentRootT>(GetSizePrefixedBadAlignmentRoot(buf)->UnPack(res)); + return std::unique_ptr<BadAlignmentRootT>(GetSizePrefixedBadAlignmentRoot(buf)->UnPack(res)); } #endif // FLATBUFFERS_GENERATED_ALIGNMENTTEST_H_ diff --git a/tests/arrays_test_generated.h b/tests/arrays_test_generated.h index 7df769f4..3d137f89 100644 --- a/tests/arrays_test_generated.h +++ b/tests/arrays_test_generated.h @@ -271,7 +271,7 @@ inline bool operator!=(const ArrayStruct &lhs, const ArrayStruct &rhs) { struct ArrayTableT : public ::flatbuffers::NativeTable { typedef ArrayTable TableType; - flatbuffers::unique_ptr<MyGame::Example::ArrayStruct> a{}; + std::unique_ptr<MyGame::Example::ArrayStruct> a{}; ArrayTableT() = default; ArrayTableT(const ArrayTableT &o); ArrayTableT(ArrayTableT&&) FLATBUFFERS_NOEXCEPT = default; @@ -360,7 +360,7 @@ inline ArrayTableT *ArrayTable::UnPack(const ::flatbuffers::resolver_function_t inline void ArrayTable::UnPackTo(ArrayTableT *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = a(); if (_e) _o->a = flatbuffers::unique_ptr<MyGame::Example::ArrayStruct>(new MyGame::Example::ArrayStruct(*_e)); } + { auto _e = a(); if (_e) _o->a = std::unique_ptr<MyGame::Example::ArrayStruct>(new MyGame::Example::ArrayStruct(*_e)); } } inline ::flatbuffers::Offset<ArrayTable> ArrayTable::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const ArrayTableT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) { @@ -521,16 +521,16 @@ inline void FinishSizePrefixedArrayTableBuffer( fbb.FinishSizePrefixed(root, ArrayTableIdentifier()); } -inline flatbuffers::unique_ptr<MyGame::Example::ArrayTableT> UnPackArrayTable( +inline std::unique_ptr<MyGame::Example::ArrayTableT> UnPackArrayTable( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::Example::ArrayTableT>(GetArrayTable(buf)->UnPack(res)); + return std::unique_ptr<MyGame::Example::ArrayTableT>(GetArrayTable(buf)->UnPack(res)); } -inline flatbuffers::unique_ptr<MyGame::Example::ArrayTableT> UnPackSizePrefixedArrayTable( +inline std::unique_ptr<MyGame::Example::ArrayTableT> UnPackSizePrefixedArrayTable( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::Example::ArrayTableT>(GetSizePrefixedArrayTable(buf)->UnPack(res)); + return std::unique_ptr<MyGame::Example::ArrayTableT>(GetSizePrefixedArrayTable(buf)->UnPack(res)); } } // namespace Example diff --git a/tests/monster_extra_generated.h b/tests/monster_extra_generated.h index 6ed45fe2..ac8f6147 100644 --- a/tests/monster_extra_generated.h +++ b/tests/monster_extra_generated.h @@ -400,16 +400,16 @@ inline void FinishSizePrefixedMonsterExtraBuffer( fbb.FinishSizePrefixed(root, MonsterExtraIdentifier()); } -inline flatbuffers::unique_ptr<MyGame::MonsterExtraT> UnPackMonsterExtra( +inline std::unique_ptr<MyGame::MonsterExtraT> UnPackMonsterExtra( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::MonsterExtraT>(GetMonsterExtra(buf)->UnPack(res)); + return std::unique_ptr<MyGame::MonsterExtraT>(GetMonsterExtra(buf)->UnPack(res)); } -inline flatbuffers::unique_ptr<MyGame::MonsterExtraT> UnPackSizePrefixedMonsterExtra( +inline std::unique_ptr<MyGame::MonsterExtraT> UnPackSizePrefixedMonsterExtra( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::MonsterExtraT>(GetSizePrefixedMonsterExtra(buf)->UnPack(res)); + return std::unique_ptr<MyGame::MonsterExtraT>(GetSizePrefixedMonsterExtra(buf)->UnPack(res)); } } // namespace MyGame diff --git a/tests/monster_test_generated.h b/tests/monster_test_generated.h index 127522dc..f7b8f4ac 100644 --- a/tests/monster_test_generated.h +++ b/tests/monster_test_generated.h @@ -1267,7 +1267,7 @@ inline ::flatbuffers::Offset<Referrable> CreateReferrable( struct MonsterT : public ::flatbuffers::NativeTable { typedef Monster TableType; - flatbuffers::unique_ptr<MyGame::Example::Vec3> pos{}; + std::unique_ptr<MyGame::Example::Vec3> pos{}; int16_t mana = 150; int16_t hp = 100; std::string name{}; @@ -1276,10 +1276,10 @@ struct MonsterT : public ::flatbuffers::NativeTable { MyGame::Example::AnyUnion test{}; std::vector<MyGame::Example::Test> test4{}; std::vector<std::string> testarrayofstring{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::MonsterT>> testarrayoftables{}; - flatbuffers::unique_ptr<MyGame::Example::MonsterT> enemy{}; + std::vector<std::unique_ptr<MyGame::Example::MonsterT>> testarrayoftables{}; + std::unique_ptr<MyGame::Example::MonsterT> enemy{}; std::vector<uint8_t> testnestedflatbuffer{}; - flatbuffers::unique_ptr<MyGame::Example::StatT> testempty{}; + std::unique_ptr<MyGame::Example::StatT> testempty{}; bool testbool = false; int32_t testhashs32_fnv1 = 0; uint32_t testhashu32_fnv1 = 0; @@ -1299,13 +1299,13 @@ struct MonsterT : public ::flatbuffers::NativeTable { std::vector<MyGame::Example::Test> test5{}; std::vector<int64_t> vector_of_longs{}; std::vector<double> vector_of_doubles{}; - flatbuffers::unique_ptr<MyGame::InParentNamespaceT> parent_namespace_test{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::ReferrableT>> vector_of_referrables{}; + std::unique_ptr<MyGame::InParentNamespaceT> parent_namespace_test{}; + std::vector<std::unique_ptr<MyGame::Example::ReferrableT>> vector_of_referrables{}; ReferrableT *single_weak_reference = nullptr; std::vector<ReferrableT *> vector_of_weak_references{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::ReferrableT>> vector_of_strong_referrables{}; + std::vector<std::unique_ptr<MyGame::Example::ReferrableT>> vector_of_strong_referrables{}; ReferrableT *co_owning_reference = nullptr; - std::vector<flatbuffers::unique_ptr<ReferrableT>> vector_of_co_owning_references{}; + std::vector<std::unique_ptr<ReferrableT>> vector_of_co_owning_references{}; ReferrableT *non_owning_reference = nullptr; std::vector<ReferrableT *> vector_of_non_owning_references{}; MyGame::Example::AnyUniqueAliasesUnion any_unique{}; @@ -1313,7 +1313,7 @@ struct MonsterT : public ::flatbuffers::NativeTable { std::vector<MyGame::Example::Color> vector_of_enums{}; MyGame::Example::Race signed_enum = MyGame::Example::Race_None; std::vector<uint8_t> testrequirednestedflatbuffer{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::StatT>> scalar_key_sorted_tables{}; + std::vector<std::unique_ptr<MyGame::Example::StatT>> scalar_key_sorted_tables{}; MyGame::Example::Test native_inline{}; MyGame::Example::LongEnum long_enum_non_enum_default = static_cast<MyGame::Example::LongEnum>(0); MyGame::Example::LongEnum long_enum_normal_default = MyGame::Example::LongEnum_LongOne; @@ -2871,7 +2871,7 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.test == rhs.test) && (lhs.test4 == rhs.test4) && (lhs.testarrayofstring == rhs.testarrayofstring) && - (lhs.testarrayoftables.size() == rhs.testarrayoftables.size() && std::equal(lhs.testarrayoftables.cbegin(), lhs.testarrayoftables.cend(), rhs.testarrayoftables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::MonsterT> const &a, flatbuffers::unique_ptr<MyGame::Example::MonsterT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.testarrayoftables.size() == rhs.testarrayoftables.size() && std::equal(lhs.testarrayoftables.cbegin(), lhs.testarrayoftables.cend(), rhs.testarrayoftables.cbegin(), [](std::unique_ptr<MyGame::Example::MonsterT> const &a, std::unique_ptr<MyGame::Example::MonsterT> const &b) { return (a == b) || (a && b && *a == *b); })) && ((lhs.enemy == rhs.enemy) || (lhs.enemy && rhs.enemy && *lhs.enemy == *rhs.enemy)) && (lhs.testnestedflatbuffer == rhs.testnestedflatbuffer) && ((lhs.testempty == rhs.testempty) || (lhs.testempty && rhs.testempty && *lhs.testempty == *rhs.testempty)) && @@ -2895,10 +2895,10 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.vector_of_longs == rhs.vector_of_longs) && (lhs.vector_of_doubles == rhs.vector_of_doubles) && ((lhs.parent_namespace_test == rhs.parent_namespace_test) || (lhs.parent_namespace_test && rhs.parent_namespace_test && *lhs.parent_namespace_test == *rhs.parent_namespace_test)) && - (lhs.vector_of_referrables.size() == rhs.vector_of_referrables.size() && std::equal(lhs.vector_of_referrables.cbegin(), lhs.vector_of_referrables.cend(), rhs.vector_of_referrables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &a, flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.vector_of_referrables.size() == rhs.vector_of_referrables.size() && std::equal(lhs.vector_of_referrables.cbegin(), lhs.vector_of_referrables.cend(), rhs.vector_of_referrables.cbegin(), [](std::unique_ptr<MyGame::Example::ReferrableT> const &a, std::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.single_weak_reference == rhs.single_weak_reference) && (lhs.vector_of_weak_references == rhs.vector_of_weak_references) && - (lhs.vector_of_strong_referrables.size() == rhs.vector_of_strong_referrables.size() && std::equal(lhs.vector_of_strong_referrables.cbegin(), lhs.vector_of_strong_referrables.cend(), rhs.vector_of_strong_referrables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &a, flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.vector_of_strong_referrables.size() == rhs.vector_of_strong_referrables.size() && std::equal(lhs.vector_of_strong_referrables.cbegin(), lhs.vector_of_strong_referrables.cend(), rhs.vector_of_strong_referrables.cbegin(), [](std::unique_ptr<MyGame::Example::ReferrableT> const &a, std::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.co_owning_reference == rhs.co_owning_reference) && (lhs.vector_of_co_owning_references == rhs.vector_of_co_owning_references) && (lhs.non_owning_reference == rhs.non_owning_reference) && @@ -2908,7 +2908,7 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.vector_of_enums == rhs.vector_of_enums) && (lhs.signed_enum == rhs.signed_enum) && (lhs.testrequirednestedflatbuffer == rhs.testrequirednestedflatbuffer) && - (lhs.scalar_key_sorted_tables.size() == rhs.scalar_key_sorted_tables.size() && std::equal(lhs.scalar_key_sorted_tables.cbegin(), lhs.scalar_key_sorted_tables.cend(), rhs.scalar_key_sorted_tables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::StatT> const &a, flatbuffers::unique_ptr<MyGame::Example::StatT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.scalar_key_sorted_tables.size() == rhs.scalar_key_sorted_tables.size() && std::equal(lhs.scalar_key_sorted_tables.cbegin(), lhs.scalar_key_sorted_tables.cend(), rhs.scalar_key_sorted_tables.cbegin(), [](std::unique_ptr<MyGame::Example::StatT> const &a, std::unique_ptr<MyGame::Example::StatT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.native_inline == rhs.native_inline) && (lhs.long_enum_non_enum_default == rhs.long_enum_non_enum_default) && (lhs.long_enum_normal_default == rhs.long_enum_normal_default) && @@ -3064,7 +3064,7 @@ inline MonsterT *Monster::UnPack(const ::flatbuffers::resolver_function_t *_reso inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = pos(); if (_e) _o->pos = flatbuffers::unique_ptr<MyGame::Example::Vec3>(new MyGame::Example::Vec3(*_e)); } + { auto _e = pos(); if (_e) _o->pos = std::unique_ptr<MyGame::Example::Vec3>(new MyGame::Example::Vec3(*_e)); } { auto _e = mana(); _o->mana = _e; } { auto _e = hp(); _o->hp = _e; } { auto _e = name(); if (_e) _o->name = _e->str(); } @@ -3074,10 +3074,10 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = test(); if (_e) _o->test.value = MyGame::Example::AnyUnion::UnPack(_e, test_type(), _resolver); } { auto _e = test4(); if (_e) { _o->test4.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->test4[_i] = *_e->Get(_i); } } else { _o->test4.resize(0); } } { auto _e = testarrayofstring(); if (_e) { _o->testarrayofstring.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->testarrayofstring[_i] = _e->Get(_i)->str(); } } else { _o->testarrayofstring.resize(0); } } - { auto _e = testarrayoftables(); if (_e) { _o->testarrayoftables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->testarrayoftables[_i]) { _e->Get(_i)->UnPackTo(_o->testarrayoftables[_i].get(), _resolver); } else { _o->testarrayoftables[_i] = flatbuffers::unique_ptr<MyGame::Example::MonsterT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->testarrayoftables.resize(0); } } - { auto _e = enemy(); if (_e) { if(_o->enemy) { _e->UnPackTo(_o->enemy.get(), _resolver); } else { _o->enemy = flatbuffers::unique_ptr<MyGame::Example::MonsterT>(_e->UnPack(_resolver)); } } else if (_o->enemy) { _o->enemy.reset(); } } + { auto _e = testarrayoftables(); if (_e) { _o->testarrayoftables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->testarrayoftables[_i]) { _e->Get(_i)->UnPackTo(_o->testarrayoftables[_i].get(), _resolver); } else { _o->testarrayoftables[_i] = std::unique_ptr<MyGame::Example::MonsterT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->testarrayoftables.resize(0); } } + { auto _e = enemy(); if (_e) { if(_o->enemy) { _e->UnPackTo(_o->enemy.get(), _resolver); } else { _o->enemy = std::unique_ptr<MyGame::Example::MonsterT>(_e->UnPack(_resolver)); } } else if (_o->enemy) { _o->enemy.reset(); } } { auto _e = testnestedflatbuffer(); if (_e) { _o->testnestedflatbuffer.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->testnestedflatbuffer.begin()); } } - { auto _e = testempty(); if (_e) { if(_o->testempty) { _e->UnPackTo(_o->testempty.get(), _resolver); } else { _o->testempty = flatbuffers::unique_ptr<MyGame::Example::StatT>(_e->UnPack(_resolver)); } } else if (_o->testempty) { _o->testempty.reset(); } } + { auto _e = testempty(); if (_e) { if(_o->testempty) { _e->UnPackTo(_o->testempty.get(), _resolver); } else { _o->testempty = std::unique_ptr<MyGame::Example::StatT>(_e->UnPack(_resolver)); } } else if (_o->testempty) { _o->testempty.reset(); } } { auto _e = testbool(); _o->testbool = _e; } { auto _e = testhashs32_fnv1(); _o->testhashs32_fnv1 = _e; } { auto _e = testhashu32_fnv1(); _o->testhashu32_fnv1 = _e; } @@ -3097,11 +3097,11 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = test5(); if (_e) { _o->test5.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->test5[_i] = *_e->Get(_i); } } else { _o->test5.resize(0); } } { auto _e = vector_of_longs(); if (_e) { _o->vector_of_longs.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_longs[_i] = _e->Get(_i); } } else { _o->vector_of_longs.resize(0); } } { auto _e = vector_of_doubles(); if (_e) { _o->vector_of_doubles.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_doubles[_i] = _e->Get(_i); } } else { _o->vector_of_doubles.resize(0); } } - { auto _e = parent_namespace_test(); if (_e) { if(_o->parent_namespace_test) { _e->UnPackTo(_o->parent_namespace_test.get(), _resolver); } else { _o->parent_namespace_test = flatbuffers::unique_ptr<MyGame::InParentNamespaceT>(_e->UnPack(_resolver)); } } else if (_o->parent_namespace_test) { _o->parent_namespace_test.reset(); } } - { auto _e = vector_of_referrables(); if (_e) { _o->vector_of_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_referrables[_i].get(), _resolver); } else { _o->vector_of_referrables[_i] = flatbuffers::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_referrables.resize(0); } } + { auto _e = parent_namespace_test(); if (_e) { if(_o->parent_namespace_test) { _e->UnPackTo(_o->parent_namespace_test.get(), _resolver); } else { _o->parent_namespace_test = std::unique_ptr<MyGame::InParentNamespaceT>(_e->UnPack(_resolver)); } } else if (_o->parent_namespace_test) { _o->parent_namespace_test.reset(); } } + { auto _e = vector_of_referrables(); if (_e) { _o->vector_of_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_referrables[_i].get(), _resolver); } else { _o->vector_of_referrables[_i] = std::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_referrables.resize(0); } } { auto _e = single_weak_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->single_weak_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->single_weak_reference = nullptr; } { auto _e = vector_of_weak_references(); if (_e) { _o->vector_of_weak_references.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { /*vector resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_weak_references[_i]), static_cast<::flatbuffers::hash_value_t>(_e->Get(_i))); else _o->vector_of_weak_references[_i] = nullptr; } } else { _o->vector_of_weak_references.resize(0); } } - { auto _e = vector_of_strong_referrables(); if (_e) { _o->vector_of_strong_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_strong_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_strong_referrables[_i].get(), _resolver); } else { _o->vector_of_strong_referrables[_i] = flatbuffers::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_strong_referrables.resize(0); } } + { auto _e = vector_of_strong_referrables(); if (_e) { _o->vector_of_strong_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_strong_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_strong_referrables[_i].get(), _resolver); } else { _o->vector_of_strong_referrables[_i] = std::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_strong_referrables.resize(0); } } { auto _e = co_owning_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->co_owning_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->co_owning_reference = nullptr; } { auto _e = vector_of_co_owning_references(); if (_e) { _o->vector_of_co_owning_references.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { /*vector resolver, default_ptr_type*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_co_owning_references[_i]), static_cast<::flatbuffers::hash_value_t>(_e->Get(_i)));/* else do nothing */; } } else { _o->vector_of_co_owning_references.resize(0); } } { auto _e = non_owning_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->non_owning_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->non_owning_reference = nullptr; } @@ -3113,7 +3113,7 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = vector_of_enums(); if (_e) { _o->vector_of_enums.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_enums[_i] = static_cast<MyGame::Example::Color>(_e->Get(_i)); } } else { _o->vector_of_enums.resize(0); } } { auto _e = signed_enum(); _o->signed_enum = _e; } { auto _e = testrequirednestedflatbuffer(); if (_e) { _o->testrequirednestedflatbuffer.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->testrequirednestedflatbuffer.begin()); } } - { auto _e = scalar_key_sorted_tables(); if (_e) { _o->scalar_key_sorted_tables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->scalar_key_sorted_tables[_i]) { _e->Get(_i)->UnPackTo(_o->scalar_key_sorted_tables[_i].get(), _resolver); } else { _o->scalar_key_sorted_tables[_i] = flatbuffers::unique_ptr<MyGame::Example::StatT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->scalar_key_sorted_tables.resize(0); } } + { auto _e = scalar_key_sorted_tables(); if (_e) { _o->scalar_key_sorted_tables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->scalar_key_sorted_tables[_i]) { _e->Get(_i)->UnPackTo(_o->scalar_key_sorted_tables[_i].get(), _resolver); } else { _o->scalar_key_sorted_tables[_i] = std::unique_ptr<MyGame::Example::StatT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->scalar_key_sorted_tables.resize(0); } } { auto _e = native_inline(); if (_e) _o->native_inline = *_e; } { auto _e = long_enum_non_enum_default(); _o->long_enum_non_enum_default = _e; } { auto _e = long_enum_normal_default(); _o->long_enum_normal_default = _e; } @@ -4224,16 +4224,16 @@ inline void FinishSizePrefixedMonsterBuffer( fbb.FinishSizePrefixed(root, MonsterIdentifier()); } -inline flatbuffers::unique_ptr<MyGame::Example::MonsterT> UnPackMonster( +inline std::unique_ptr<MyGame::Example::MonsterT> UnPackMonster( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::Example::MonsterT>(GetMonster(buf)->UnPack(res)); + return std::unique_ptr<MyGame::Example::MonsterT>(GetMonster(buf)->UnPack(res)); } -inline flatbuffers::unique_ptr<MyGame::Example::MonsterT> UnPackSizePrefixedMonster( +inline std::unique_ptr<MyGame::Example::MonsterT> UnPackSizePrefixedMonster( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::Example::MonsterT>(GetSizePrefixedMonster(buf)->UnPack(res)); + return std::unique_ptr<MyGame::Example::MonsterT>(GetSizePrefixedMonster(buf)->UnPack(res)); } } // namespace Example diff --git a/tests/monster_test_suffix/ext_only/monster_test_generated.hpp b/tests/monster_test_suffix/ext_only/monster_test_generated.hpp index d11788e1..9c64fbbc 100644 --- a/tests/monster_test_suffix/ext_only/monster_test_generated.hpp +++ b/tests/monster_test_suffix/ext_only/monster_test_generated.hpp @@ -1259,7 +1259,7 @@ inline ::flatbuffers::Offset<Referrable> CreateReferrable( struct MonsterT : public ::flatbuffers::NativeTable { typedef Monster TableType; - flatbuffers::unique_ptr<MyGame::Example::Vec3> pos{}; + std::unique_ptr<MyGame::Example::Vec3> pos{}; int16_t mana = 150; int16_t hp = 100; std::string name{}; @@ -1268,10 +1268,10 @@ struct MonsterT : public ::flatbuffers::NativeTable { MyGame::Example::AnyUnion test{}; std::vector<MyGame::Example::Test> test4{}; std::vector<std::string> testarrayofstring{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::MonsterT>> testarrayoftables{}; - flatbuffers::unique_ptr<MyGame::Example::MonsterT> enemy{}; + std::vector<std::unique_ptr<MyGame::Example::MonsterT>> testarrayoftables{}; + std::unique_ptr<MyGame::Example::MonsterT> enemy{}; std::vector<uint8_t> testnestedflatbuffer{}; - flatbuffers::unique_ptr<MyGame::Example::StatT> testempty{}; + std::unique_ptr<MyGame::Example::StatT> testempty{}; bool testbool = false; int32_t testhashs32_fnv1 = 0; uint32_t testhashu32_fnv1 = 0; @@ -1291,13 +1291,13 @@ struct MonsterT : public ::flatbuffers::NativeTable { std::vector<MyGame::Example::Test> test5{}; std::vector<int64_t> vector_of_longs{}; std::vector<double> vector_of_doubles{}; - flatbuffers::unique_ptr<MyGame::InParentNamespaceT> parent_namespace_test{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::ReferrableT>> vector_of_referrables{}; + std::unique_ptr<MyGame::InParentNamespaceT> parent_namespace_test{}; + std::vector<std::unique_ptr<MyGame::Example::ReferrableT>> vector_of_referrables{}; ReferrableT *single_weak_reference = nullptr; std::vector<ReferrableT *> vector_of_weak_references{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::ReferrableT>> vector_of_strong_referrables{}; + std::vector<std::unique_ptr<MyGame::Example::ReferrableT>> vector_of_strong_referrables{}; ReferrableT *co_owning_reference = nullptr; - std::vector<flatbuffers::unique_ptr<ReferrableT>> vector_of_co_owning_references{}; + std::vector<std::unique_ptr<ReferrableT>> vector_of_co_owning_references{}; ReferrableT *non_owning_reference = nullptr; std::vector<ReferrableT *> vector_of_non_owning_references{}; MyGame::Example::AnyUniqueAliasesUnion any_unique{}; @@ -1305,7 +1305,7 @@ struct MonsterT : public ::flatbuffers::NativeTable { std::vector<MyGame::Example::Color> vector_of_enums{}; MyGame::Example::Race signed_enum = MyGame::Example::Race_None; std::vector<uint8_t> testrequirednestedflatbuffer{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::StatT>> scalar_key_sorted_tables{}; + std::vector<std::unique_ptr<MyGame::Example::StatT>> scalar_key_sorted_tables{}; MyGame::Example::Test native_inline{}; MyGame::Example::LongEnum long_enum_non_enum_default = static_cast<MyGame::Example::LongEnum>(0); MyGame::Example::LongEnum long_enum_normal_default = MyGame::Example::LongEnum_LongOne; @@ -2861,7 +2861,7 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.test == rhs.test) && (lhs.test4 == rhs.test4) && (lhs.testarrayofstring == rhs.testarrayofstring) && - (lhs.testarrayoftables.size() == rhs.testarrayoftables.size() && std::equal(lhs.testarrayoftables.cbegin(), lhs.testarrayoftables.cend(), rhs.testarrayoftables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::MonsterT> const &a, flatbuffers::unique_ptr<MyGame::Example::MonsterT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.testarrayoftables.size() == rhs.testarrayoftables.size() && std::equal(lhs.testarrayoftables.cbegin(), lhs.testarrayoftables.cend(), rhs.testarrayoftables.cbegin(), [](std::unique_ptr<MyGame::Example::MonsterT> const &a, std::unique_ptr<MyGame::Example::MonsterT> const &b) { return (a == b) || (a && b && *a == *b); })) && ((lhs.enemy == rhs.enemy) || (lhs.enemy && rhs.enemy && *lhs.enemy == *rhs.enemy)) && (lhs.testnestedflatbuffer == rhs.testnestedflatbuffer) && ((lhs.testempty == rhs.testempty) || (lhs.testempty && rhs.testempty && *lhs.testempty == *rhs.testempty)) && @@ -2885,10 +2885,10 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.vector_of_longs == rhs.vector_of_longs) && (lhs.vector_of_doubles == rhs.vector_of_doubles) && ((lhs.parent_namespace_test == rhs.parent_namespace_test) || (lhs.parent_namespace_test && rhs.parent_namespace_test && *lhs.parent_namespace_test == *rhs.parent_namespace_test)) && - (lhs.vector_of_referrables.size() == rhs.vector_of_referrables.size() && std::equal(lhs.vector_of_referrables.cbegin(), lhs.vector_of_referrables.cend(), rhs.vector_of_referrables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &a, flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.vector_of_referrables.size() == rhs.vector_of_referrables.size() && std::equal(lhs.vector_of_referrables.cbegin(), lhs.vector_of_referrables.cend(), rhs.vector_of_referrables.cbegin(), [](std::unique_ptr<MyGame::Example::ReferrableT> const &a, std::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.single_weak_reference == rhs.single_weak_reference) && (lhs.vector_of_weak_references == rhs.vector_of_weak_references) && - (lhs.vector_of_strong_referrables.size() == rhs.vector_of_strong_referrables.size() && std::equal(lhs.vector_of_strong_referrables.cbegin(), lhs.vector_of_strong_referrables.cend(), rhs.vector_of_strong_referrables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &a, flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.vector_of_strong_referrables.size() == rhs.vector_of_strong_referrables.size() && std::equal(lhs.vector_of_strong_referrables.cbegin(), lhs.vector_of_strong_referrables.cend(), rhs.vector_of_strong_referrables.cbegin(), [](std::unique_ptr<MyGame::Example::ReferrableT> const &a, std::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.co_owning_reference == rhs.co_owning_reference) && (lhs.vector_of_co_owning_references == rhs.vector_of_co_owning_references) && (lhs.non_owning_reference == rhs.non_owning_reference) && @@ -2898,7 +2898,7 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.vector_of_enums == rhs.vector_of_enums) && (lhs.signed_enum == rhs.signed_enum) && (lhs.testrequirednestedflatbuffer == rhs.testrequirednestedflatbuffer) && - (lhs.scalar_key_sorted_tables.size() == rhs.scalar_key_sorted_tables.size() && std::equal(lhs.scalar_key_sorted_tables.cbegin(), lhs.scalar_key_sorted_tables.cend(), rhs.scalar_key_sorted_tables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::StatT> const &a, flatbuffers::unique_ptr<MyGame::Example::StatT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.scalar_key_sorted_tables.size() == rhs.scalar_key_sorted_tables.size() && std::equal(lhs.scalar_key_sorted_tables.cbegin(), lhs.scalar_key_sorted_tables.cend(), rhs.scalar_key_sorted_tables.cbegin(), [](std::unique_ptr<MyGame::Example::StatT> const &a, std::unique_ptr<MyGame::Example::StatT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.native_inline == rhs.native_inline) && (lhs.long_enum_non_enum_default == rhs.long_enum_non_enum_default) && (lhs.long_enum_normal_default == rhs.long_enum_normal_default) && @@ -3054,7 +3054,7 @@ inline MonsterT *Monster::UnPack(const ::flatbuffers::resolver_function_t *_reso inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = pos(); if (_e) _o->pos = flatbuffers::unique_ptr<MyGame::Example::Vec3>(new MyGame::Example::Vec3(*_e)); } + { auto _e = pos(); if (_e) _o->pos = std::unique_ptr<MyGame::Example::Vec3>(new MyGame::Example::Vec3(*_e)); } { auto _e = mana(); _o->mana = _e; } { auto _e = hp(); _o->hp = _e; } { auto _e = name(); if (_e) _o->name = _e->str(); } @@ -3064,10 +3064,10 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = test(); if (_e) _o->test.value = MyGame::Example::AnyUnion::UnPack(_e, test_type(), _resolver); } { auto _e = test4(); if (_e) { _o->test4.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->test4[_i] = *_e->Get(_i); } } else { _o->test4.resize(0); } } { auto _e = testarrayofstring(); if (_e) { _o->testarrayofstring.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->testarrayofstring[_i] = _e->Get(_i)->str(); } } else { _o->testarrayofstring.resize(0); } } - { auto _e = testarrayoftables(); if (_e) { _o->testarrayoftables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->testarrayoftables[_i]) { _e->Get(_i)->UnPackTo(_o->testarrayoftables[_i].get(), _resolver); } else { _o->testarrayoftables[_i] = flatbuffers::unique_ptr<MyGame::Example::MonsterT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->testarrayoftables.resize(0); } } - { auto _e = enemy(); if (_e) { if(_o->enemy) { _e->UnPackTo(_o->enemy.get(), _resolver); } else { _o->enemy = flatbuffers::unique_ptr<MyGame::Example::MonsterT>(_e->UnPack(_resolver)); } } else if (_o->enemy) { _o->enemy.reset(); } } + { auto _e = testarrayoftables(); if (_e) { _o->testarrayoftables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->testarrayoftables[_i]) { _e->Get(_i)->UnPackTo(_o->testarrayoftables[_i].get(), _resolver); } else { _o->testarrayoftables[_i] = std::unique_ptr<MyGame::Example::MonsterT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->testarrayoftables.resize(0); } } + { auto _e = enemy(); if (_e) { if(_o->enemy) { _e->UnPackTo(_o->enemy.get(), _resolver); } else { _o->enemy = std::unique_ptr<MyGame::Example::MonsterT>(_e->UnPack(_resolver)); } } else if (_o->enemy) { _o->enemy.reset(); } } { auto _e = testnestedflatbuffer(); if (_e) { _o->testnestedflatbuffer.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->testnestedflatbuffer.begin()); } } - { auto _e = testempty(); if (_e) { if(_o->testempty) { _e->UnPackTo(_o->testempty.get(), _resolver); } else { _o->testempty = flatbuffers::unique_ptr<MyGame::Example::StatT>(_e->UnPack(_resolver)); } } else if (_o->testempty) { _o->testempty.reset(); } } + { auto _e = testempty(); if (_e) { if(_o->testempty) { _e->UnPackTo(_o->testempty.get(), _resolver); } else { _o->testempty = std::unique_ptr<MyGame::Example::StatT>(_e->UnPack(_resolver)); } } else if (_o->testempty) { _o->testempty.reset(); } } { auto _e = testbool(); _o->testbool = _e; } { auto _e = testhashs32_fnv1(); _o->testhashs32_fnv1 = _e; } { auto _e = testhashu32_fnv1(); _o->testhashu32_fnv1 = _e; } @@ -3087,11 +3087,11 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = test5(); if (_e) { _o->test5.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->test5[_i] = *_e->Get(_i); } } else { _o->test5.resize(0); } } { auto _e = vector_of_longs(); if (_e) { _o->vector_of_longs.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_longs[_i] = _e->Get(_i); } } else { _o->vector_of_longs.resize(0); } } { auto _e = vector_of_doubles(); if (_e) { _o->vector_of_doubles.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_doubles[_i] = _e->Get(_i); } } else { _o->vector_of_doubles.resize(0); } } - { auto _e = parent_namespace_test(); if (_e) { if(_o->parent_namespace_test) { _e->UnPackTo(_o->parent_namespace_test.get(), _resolver); } else { _o->parent_namespace_test = flatbuffers::unique_ptr<MyGame::InParentNamespaceT>(_e->UnPack(_resolver)); } } else if (_o->parent_namespace_test) { _o->parent_namespace_test.reset(); } } - { auto _e = vector_of_referrables(); if (_e) { _o->vector_of_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_referrables[_i].get(), _resolver); } else { _o->vector_of_referrables[_i] = flatbuffers::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_referrables.resize(0); } } + { auto _e = parent_namespace_test(); if (_e) { if(_o->parent_namespace_test) { _e->UnPackTo(_o->parent_namespace_test.get(), _resolver); } else { _o->parent_namespace_test = std::unique_ptr<MyGame::InParentNamespaceT>(_e->UnPack(_resolver)); } } else if (_o->parent_namespace_test) { _o->parent_namespace_test.reset(); } } + { auto _e = vector_of_referrables(); if (_e) { _o->vector_of_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_referrables[_i].get(), _resolver); } else { _o->vector_of_referrables[_i] = std::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_referrables.resize(0); } } { auto _e = single_weak_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->single_weak_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->single_weak_reference = nullptr; } { auto _e = vector_of_weak_references(); if (_e) { _o->vector_of_weak_references.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { /*vector resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_weak_references[_i]), static_cast<::flatbuffers::hash_value_t>(_e->Get(_i))); else _o->vector_of_weak_references[_i] = nullptr; } } else { _o->vector_of_weak_references.resize(0); } } - { auto _e = vector_of_strong_referrables(); if (_e) { _o->vector_of_strong_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_strong_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_strong_referrables[_i].get(), _resolver); } else { _o->vector_of_strong_referrables[_i] = flatbuffers::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_strong_referrables.resize(0); } } + { auto _e = vector_of_strong_referrables(); if (_e) { _o->vector_of_strong_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_strong_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_strong_referrables[_i].get(), _resolver); } else { _o->vector_of_strong_referrables[_i] = std::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_strong_referrables.resize(0); } } { auto _e = co_owning_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->co_owning_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->co_owning_reference = nullptr; } { auto _e = vector_of_co_owning_references(); if (_e) { _o->vector_of_co_owning_references.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { /*vector resolver, default_ptr_type*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_co_owning_references[_i]), static_cast<::flatbuffers::hash_value_t>(_e->Get(_i)));/* else do nothing */; } } else { _o->vector_of_co_owning_references.resize(0); } } { auto _e = non_owning_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->non_owning_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->non_owning_reference = nullptr; } @@ -3103,7 +3103,7 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = vector_of_enums(); if (_e) { _o->vector_of_enums.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_enums[_i] = static_cast<MyGame::Example::Color>(_e->Get(_i)); } } else { _o->vector_of_enums.resize(0); } } { auto _e = signed_enum(); _o->signed_enum = _e; } { auto _e = testrequirednestedflatbuffer(); if (_e) { _o->testrequirednestedflatbuffer.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->testrequirednestedflatbuffer.begin()); } } - { auto _e = scalar_key_sorted_tables(); if (_e) { _o->scalar_key_sorted_tables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->scalar_key_sorted_tables[_i]) { _e->Get(_i)->UnPackTo(_o->scalar_key_sorted_tables[_i].get(), _resolver); } else { _o->scalar_key_sorted_tables[_i] = flatbuffers::unique_ptr<MyGame::Example::StatT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->scalar_key_sorted_tables.resize(0); } } + { auto _e = scalar_key_sorted_tables(); if (_e) { _o->scalar_key_sorted_tables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->scalar_key_sorted_tables[_i]) { _e->Get(_i)->UnPackTo(_o->scalar_key_sorted_tables[_i].get(), _resolver); } else { _o->scalar_key_sorted_tables[_i] = std::unique_ptr<MyGame::Example::StatT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->scalar_key_sorted_tables.resize(0); } } { auto _e = native_inline(); if (_e) _o->native_inline = *_e; } { auto _e = long_enum_non_enum_default(); _o->long_enum_non_enum_default = _e; } { auto _e = long_enum_normal_default(); _o->long_enum_normal_default = _e; } @@ -4214,16 +4214,16 @@ inline void FinishSizePrefixedMonsterBuffer( fbb.FinishSizePrefixed(root, MonsterIdentifier()); } -inline flatbuffers::unique_ptr<MyGame::Example::MonsterT> UnPackMonster( +inline std::unique_ptr<MyGame::Example::MonsterT> UnPackMonster( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::Example::MonsterT>(GetMonster(buf)->UnPack(res)); + return std::unique_ptr<MyGame::Example::MonsterT>(GetMonster(buf)->UnPack(res)); } -inline flatbuffers::unique_ptr<MyGame::Example::MonsterT> UnPackSizePrefixedMonster( +inline std::unique_ptr<MyGame::Example::MonsterT> UnPackSizePrefixedMonster( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::Example::MonsterT>(GetSizePrefixedMonster(buf)->UnPack(res)); + return std::unique_ptr<MyGame::Example::MonsterT>(GetSizePrefixedMonster(buf)->UnPack(res)); } } // namespace Example diff --git a/tests/monster_test_suffix/filesuffix_only/monster_test_suffix.h b/tests/monster_test_suffix/filesuffix_only/monster_test_suffix.h index d11788e1..9c64fbbc 100644 --- a/tests/monster_test_suffix/filesuffix_only/monster_test_suffix.h +++ b/tests/monster_test_suffix/filesuffix_only/monster_test_suffix.h @@ -1259,7 +1259,7 @@ inline ::flatbuffers::Offset<Referrable> CreateReferrable( struct MonsterT : public ::flatbuffers::NativeTable { typedef Monster TableType; - flatbuffers::unique_ptr<MyGame::Example::Vec3> pos{}; + std::unique_ptr<MyGame::Example::Vec3> pos{}; int16_t mana = 150; int16_t hp = 100; std::string name{}; @@ -1268,10 +1268,10 @@ struct MonsterT : public ::flatbuffers::NativeTable { MyGame::Example::AnyUnion test{}; std::vector<MyGame::Example::Test> test4{}; std::vector<std::string> testarrayofstring{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::MonsterT>> testarrayoftables{}; - flatbuffers::unique_ptr<MyGame::Example::MonsterT> enemy{}; + std::vector<std::unique_ptr<MyGame::Example::MonsterT>> testarrayoftables{}; + std::unique_ptr<MyGame::Example::MonsterT> enemy{}; std::vector<uint8_t> testnestedflatbuffer{}; - flatbuffers::unique_ptr<MyGame::Example::StatT> testempty{}; + std::unique_ptr<MyGame::Example::StatT> testempty{}; bool testbool = false; int32_t testhashs32_fnv1 = 0; uint32_t testhashu32_fnv1 = 0; @@ -1291,13 +1291,13 @@ struct MonsterT : public ::flatbuffers::NativeTable { std::vector<MyGame::Example::Test> test5{}; std::vector<int64_t> vector_of_longs{}; std::vector<double> vector_of_doubles{}; - flatbuffers::unique_ptr<MyGame::InParentNamespaceT> parent_namespace_test{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::ReferrableT>> vector_of_referrables{}; + std::unique_ptr<MyGame::InParentNamespaceT> parent_namespace_test{}; + std::vector<std::unique_ptr<MyGame::Example::ReferrableT>> vector_of_referrables{}; ReferrableT *single_weak_reference = nullptr; std::vector<ReferrableT *> vector_of_weak_references{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::ReferrableT>> vector_of_strong_referrables{}; + std::vector<std::unique_ptr<MyGame::Example::ReferrableT>> vector_of_strong_referrables{}; ReferrableT *co_owning_reference = nullptr; - std::vector<flatbuffers::unique_ptr<ReferrableT>> vector_of_co_owning_references{}; + std::vector<std::unique_ptr<ReferrableT>> vector_of_co_owning_references{}; ReferrableT *non_owning_reference = nullptr; std::vector<ReferrableT *> vector_of_non_owning_references{}; MyGame::Example::AnyUniqueAliasesUnion any_unique{}; @@ -1305,7 +1305,7 @@ struct MonsterT : public ::flatbuffers::NativeTable { std::vector<MyGame::Example::Color> vector_of_enums{}; MyGame::Example::Race signed_enum = MyGame::Example::Race_None; std::vector<uint8_t> testrequirednestedflatbuffer{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::StatT>> scalar_key_sorted_tables{}; + std::vector<std::unique_ptr<MyGame::Example::StatT>> scalar_key_sorted_tables{}; MyGame::Example::Test native_inline{}; MyGame::Example::LongEnum long_enum_non_enum_default = static_cast<MyGame::Example::LongEnum>(0); MyGame::Example::LongEnum long_enum_normal_default = MyGame::Example::LongEnum_LongOne; @@ -2861,7 +2861,7 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.test == rhs.test) && (lhs.test4 == rhs.test4) && (lhs.testarrayofstring == rhs.testarrayofstring) && - (lhs.testarrayoftables.size() == rhs.testarrayoftables.size() && std::equal(lhs.testarrayoftables.cbegin(), lhs.testarrayoftables.cend(), rhs.testarrayoftables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::MonsterT> const &a, flatbuffers::unique_ptr<MyGame::Example::MonsterT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.testarrayoftables.size() == rhs.testarrayoftables.size() && std::equal(lhs.testarrayoftables.cbegin(), lhs.testarrayoftables.cend(), rhs.testarrayoftables.cbegin(), [](std::unique_ptr<MyGame::Example::MonsterT> const &a, std::unique_ptr<MyGame::Example::MonsterT> const &b) { return (a == b) || (a && b && *a == *b); })) && ((lhs.enemy == rhs.enemy) || (lhs.enemy && rhs.enemy && *lhs.enemy == *rhs.enemy)) && (lhs.testnestedflatbuffer == rhs.testnestedflatbuffer) && ((lhs.testempty == rhs.testempty) || (lhs.testempty && rhs.testempty && *lhs.testempty == *rhs.testempty)) && @@ -2885,10 +2885,10 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.vector_of_longs == rhs.vector_of_longs) && (lhs.vector_of_doubles == rhs.vector_of_doubles) && ((lhs.parent_namespace_test == rhs.parent_namespace_test) || (lhs.parent_namespace_test && rhs.parent_namespace_test && *lhs.parent_namespace_test == *rhs.parent_namespace_test)) && - (lhs.vector_of_referrables.size() == rhs.vector_of_referrables.size() && std::equal(lhs.vector_of_referrables.cbegin(), lhs.vector_of_referrables.cend(), rhs.vector_of_referrables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &a, flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.vector_of_referrables.size() == rhs.vector_of_referrables.size() && std::equal(lhs.vector_of_referrables.cbegin(), lhs.vector_of_referrables.cend(), rhs.vector_of_referrables.cbegin(), [](std::unique_ptr<MyGame::Example::ReferrableT> const &a, std::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.single_weak_reference == rhs.single_weak_reference) && (lhs.vector_of_weak_references == rhs.vector_of_weak_references) && - (lhs.vector_of_strong_referrables.size() == rhs.vector_of_strong_referrables.size() && std::equal(lhs.vector_of_strong_referrables.cbegin(), lhs.vector_of_strong_referrables.cend(), rhs.vector_of_strong_referrables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &a, flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.vector_of_strong_referrables.size() == rhs.vector_of_strong_referrables.size() && std::equal(lhs.vector_of_strong_referrables.cbegin(), lhs.vector_of_strong_referrables.cend(), rhs.vector_of_strong_referrables.cbegin(), [](std::unique_ptr<MyGame::Example::ReferrableT> const &a, std::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.co_owning_reference == rhs.co_owning_reference) && (lhs.vector_of_co_owning_references == rhs.vector_of_co_owning_references) && (lhs.non_owning_reference == rhs.non_owning_reference) && @@ -2898,7 +2898,7 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.vector_of_enums == rhs.vector_of_enums) && (lhs.signed_enum == rhs.signed_enum) && (lhs.testrequirednestedflatbuffer == rhs.testrequirednestedflatbuffer) && - (lhs.scalar_key_sorted_tables.size() == rhs.scalar_key_sorted_tables.size() && std::equal(lhs.scalar_key_sorted_tables.cbegin(), lhs.scalar_key_sorted_tables.cend(), rhs.scalar_key_sorted_tables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::StatT> const &a, flatbuffers::unique_ptr<MyGame::Example::StatT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.scalar_key_sorted_tables.size() == rhs.scalar_key_sorted_tables.size() && std::equal(lhs.scalar_key_sorted_tables.cbegin(), lhs.scalar_key_sorted_tables.cend(), rhs.scalar_key_sorted_tables.cbegin(), [](std::unique_ptr<MyGame::Example::StatT> const &a, std::unique_ptr<MyGame::Example::StatT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.native_inline == rhs.native_inline) && (lhs.long_enum_non_enum_default == rhs.long_enum_non_enum_default) && (lhs.long_enum_normal_default == rhs.long_enum_normal_default) && @@ -3054,7 +3054,7 @@ inline MonsterT *Monster::UnPack(const ::flatbuffers::resolver_function_t *_reso inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = pos(); if (_e) _o->pos = flatbuffers::unique_ptr<MyGame::Example::Vec3>(new MyGame::Example::Vec3(*_e)); } + { auto _e = pos(); if (_e) _o->pos = std::unique_ptr<MyGame::Example::Vec3>(new MyGame::Example::Vec3(*_e)); } { auto _e = mana(); _o->mana = _e; } { auto _e = hp(); _o->hp = _e; } { auto _e = name(); if (_e) _o->name = _e->str(); } @@ -3064,10 +3064,10 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = test(); if (_e) _o->test.value = MyGame::Example::AnyUnion::UnPack(_e, test_type(), _resolver); } { auto _e = test4(); if (_e) { _o->test4.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->test4[_i] = *_e->Get(_i); } } else { _o->test4.resize(0); } } { auto _e = testarrayofstring(); if (_e) { _o->testarrayofstring.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->testarrayofstring[_i] = _e->Get(_i)->str(); } } else { _o->testarrayofstring.resize(0); } } - { auto _e = testarrayoftables(); if (_e) { _o->testarrayoftables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->testarrayoftables[_i]) { _e->Get(_i)->UnPackTo(_o->testarrayoftables[_i].get(), _resolver); } else { _o->testarrayoftables[_i] = flatbuffers::unique_ptr<MyGame::Example::MonsterT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->testarrayoftables.resize(0); } } - { auto _e = enemy(); if (_e) { if(_o->enemy) { _e->UnPackTo(_o->enemy.get(), _resolver); } else { _o->enemy = flatbuffers::unique_ptr<MyGame::Example::MonsterT>(_e->UnPack(_resolver)); } } else if (_o->enemy) { _o->enemy.reset(); } } + { auto _e = testarrayoftables(); if (_e) { _o->testarrayoftables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->testarrayoftables[_i]) { _e->Get(_i)->UnPackTo(_o->testarrayoftables[_i].get(), _resolver); } else { _o->testarrayoftables[_i] = std::unique_ptr<MyGame::Example::MonsterT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->testarrayoftables.resize(0); } } + { auto _e = enemy(); if (_e) { if(_o->enemy) { _e->UnPackTo(_o->enemy.get(), _resolver); } else { _o->enemy = std::unique_ptr<MyGame::Example::MonsterT>(_e->UnPack(_resolver)); } } else if (_o->enemy) { _o->enemy.reset(); } } { auto _e = testnestedflatbuffer(); if (_e) { _o->testnestedflatbuffer.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->testnestedflatbuffer.begin()); } } - { auto _e = testempty(); if (_e) { if(_o->testempty) { _e->UnPackTo(_o->testempty.get(), _resolver); } else { _o->testempty = flatbuffers::unique_ptr<MyGame::Example::StatT>(_e->UnPack(_resolver)); } } else if (_o->testempty) { _o->testempty.reset(); } } + { auto _e = testempty(); if (_e) { if(_o->testempty) { _e->UnPackTo(_o->testempty.get(), _resolver); } else { _o->testempty = std::unique_ptr<MyGame::Example::StatT>(_e->UnPack(_resolver)); } } else if (_o->testempty) { _o->testempty.reset(); } } { auto _e = testbool(); _o->testbool = _e; } { auto _e = testhashs32_fnv1(); _o->testhashs32_fnv1 = _e; } { auto _e = testhashu32_fnv1(); _o->testhashu32_fnv1 = _e; } @@ -3087,11 +3087,11 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = test5(); if (_e) { _o->test5.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->test5[_i] = *_e->Get(_i); } } else { _o->test5.resize(0); } } { auto _e = vector_of_longs(); if (_e) { _o->vector_of_longs.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_longs[_i] = _e->Get(_i); } } else { _o->vector_of_longs.resize(0); } } { auto _e = vector_of_doubles(); if (_e) { _o->vector_of_doubles.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_doubles[_i] = _e->Get(_i); } } else { _o->vector_of_doubles.resize(0); } } - { auto _e = parent_namespace_test(); if (_e) { if(_o->parent_namespace_test) { _e->UnPackTo(_o->parent_namespace_test.get(), _resolver); } else { _o->parent_namespace_test = flatbuffers::unique_ptr<MyGame::InParentNamespaceT>(_e->UnPack(_resolver)); } } else if (_o->parent_namespace_test) { _o->parent_namespace_test.reset(); } } - { auto _e = vector_of_referrables(); if (_e) { _o->vector_of_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_referrables[_i].get(), _resolver); } else { _o->vector_of_referrables[_i] = flatbuffers::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_referrables.resize(0); } } + { auto _e = parent_namespace_test(); if (_e) { if(_o->parent_namespace_test) { _e->UnPackTo(_o->parent_namespace_test.get(), _resolver); } else { _o->parent_namespace_test = std::unique_ptr<MyGame::InParentNamespaceT>(_e->UnPack(_resolver)); } } else if (_o->parent_namespace_test) { _o->parent_namespace_test.reset(); } } + { auto _e = vector_of_referrables(); if (_e) { _o->vector_of_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_referrables[_i].get(), _resolver); } else { _o->vector_of_referrables[_i] = std::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_referrables.resize(0); } } { auto _e = single_weak_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->single_weak_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->single_weak_reference = nullptr; } { auto _e = vector_of_weak_references(); if (_e) { _o->vector_of_weak_references.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { /*vector resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_weak_references[_i]), static_cast<::flatbuffers::hash_value_t>(_e->Get(_i))); else _o->vector_of_weak_references[_i] = nullptr; } } else { _o->vector_of_weak_references.resize(0); } } - { auto _e = vector_of_strong_referrables(); if (_e) { _o->vector_of_strong_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_strong_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_strong_referrables[_i].get(), _resolver); } else { _o->vector_of_strong_referrables[_i] = flatbuffers::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_strong_referrables.resize(0); } } + { auto _e = vector_of_strong_referrables(); if (_e) { _o->vector_of_strong_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_strong_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_strong_referrables[_i].get(), _resolver); } else { _o->vector_of_strong_referrables[_i] = std::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_strong_referrables.resize(0); } } { auto _e = co_owning_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->co_owning_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->co_owning_reference = nullptr; } { auto _e = vector_of_co_owning_references(); if (_e) { _o->vector_of_co_owning_references.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { /*vector resolver, default_ptr_type*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_co_owning_references[_i]), static_cast<::flatbuffers::hash_value_t>(_e->Get(_i)));/* else do nothing */; } } else { _o->vector_of_co_owning_references.resize(0); } } { auto _e = non_owning_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->non_owning_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->non_owning_reference = nullptr; } @@ -3103,7 +3103,7 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = vector_of_enums(); if (_e) { _o->vector_of_enums.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_enums[_i] = static_cast<MyGame::Example::Color>(_e->Get(_i)); } } else { _o->vector_of_enums.resize(0); } } { auto _e = signed_enum(); _o->signed_enum = _e; } { auto _e = testrequirednestedflatbuffer(); if (_e) { _o->testrequirednestedflatbuffer.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->testrequirednestedflatbuffer.begin()); } } - { auto _e = scalar_key_sorted_tables(); if (_e) { _o->scalar_key_sorted_tables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->scalar_key_sorted_tables[_i]) { _e->Get(_i)->UnPackTo(_o->scalar_key_sorted_tables[_i].get(), _resolver); } else { _o->scalar_key_sorted_tables[_i] = flatbuffers::unique_ptr<MyGame::Example::StatT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->scalar_key_sorted_tables.resize(0); } } + { auto _e = scalar_key_sorted_tables(); if (_e) { _o->scalar_key_sorted_tables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->scalar_key_sorted_tables[_i]) { _e->Get(_i)->UnPackTo(_o->scalar_key_sorted_tables[_i].get(), _resolver); } else { _o->scalar_key_sorted_tables[_i] = std::unique_ptr<MyGame::Example::StatT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->scalar_key_sorted_tables.resize(0); } } { auto _e = native_inline(); if (_e) _o->native_inline = *_e; } { auto _e = long_enum_non_enum_default(); _o->long_enum_non_enum_default = _e; } { auto _e = long_enum_normal_default(); _o->long_enum_normal_default = _e; } @@ -4214,16 +4214,16 @@ inline void FinishSizePrefixedMonsterBuffer( fbb.FinishSizePrefixed(root, MonsterIdentifier()); } -inline flatbuffers::unique_ptr<MyGame::Example::MonsterT> UnPackMonster( +inline std::unique_ptr<MyGame::Example::MonsterT> UnPackMonster( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::Example::MonsterT>(GetMonster(buf)->UnPack(res)); + return std::unique_ptr<MyGame::Example::MonsterT>(GetMonster(buf)->UnPack(res)); } -inline flatbuffers::unique_ptr<MyGame::Example::MonsterT> UnPackSizePrefixedMonster( +inline std::unique_ptr<MyGame::Example::MonsterT> UnPackSizePrefixedMonster( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::Example::MonsterT>(GetSizePrefixedMonster(buf)->UnPack(res)); + return std::unique_ptr<MyGame::Example::MonsterT>(GetSizePrefixedMonster(buf)->UnPack(res)); } } // namespace Example diff --git a/tests/monster_test_suffix/monster_test_suffix.hpp b/tests/monster_test_suffix/monster_test_suffix.hpp index d11788e1..9c64fbbc 100644 --- a/tests/monster_test_suffix/monster_test_suffix.hpp +++ b/tests/monster_test_suffix/monster_test_suffix.hpp @@ -1259,7 +1259,7 @@ inline ::flatbuffers::Offset<Referrable> CreateReferrable( struct MonsterT : public ::flatbuffers::NativeTable { typedef Monster TableType; - flatbuffers::unique_ptr<MyGame::Example::Vec3> pos{}; + std::unique_ptr<MyGame::Example::Vec3> pos{}; int16_t mana = 150; int16_t hp = 100; std::string name{}; @@ -1268,10 +1268,10 @@ struct MonsterT : public ::flatbuffers::NativeTable { MyGame::Example::AnyUnion test{}; std::vector<MyGame::Example::Test> test4{}; std::vector<std::string> testarrayofstring{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::MonsterT>> testarrayoftables{}; - flatbuffers::unique_ptr<MyGame::Example::MonsterT> enemy{}; + std::vector<std::unique_ptr<MyGame::Example::MonsterT>> testarrayoftables{}; + std::unique_ptr<MyGame::Example::MonsterT> enemy{}; std::vector<uint8_t> testnestedflatbuffer{}; - flatbuffers::unique_ptr<MyGame::Example::StatT> testempty{}; + std::unique_ptr<MyGame::Example::StatT> testempty{}; bool testbool = false; int32_t testhashs32_fnv1 = 0; uint32_t testhashu32_fnv1 = 0; @@ -1291,13 +1291,13 @@ struct MonsterT : public ::flatbuffers::NativeTable { std::vector<MyGame::Example::Test> test5{}; std::vector<int64_t> vector_of_longs{}; std::vector<double> vector_of_doubles{}; - flatbuffers::unique_ptr<MyGame::InParentNamespaceT> parent_namespace_test{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::ReferrableT>> vector_of_referrables{}; + std::unique_ptr<MyGame::InParentNamespaceT> parent_namespace_test{}; + std::vector<std::unique_ptr<MyGame::Example::ReferrableT>> vector_of_referrables{}; ReferrableT *single_weak_reference = nullptr; std::vector<ReferrableT *> vector_of_weak_references{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::ReferrableT>> vector_of_strong_referrables{}; + std::vector<std::unique_ptr<MyGame::Example::ReferrableT>> vector_of_strong_referrables{}; ReferrableT *co_owning_reference = nullptr; - std::vector<flatbuffers::unique_ptr<ReferrableT>> vector_of_co_owning_references{}; + std::vector<std::unique_ptr<ReferrableT>> vector_of_co_owning_references{}; ReferrableT *non_owning_reference = nullptr; std::vector<ReferrableT *> vector_of_non_owning_references{}; MyGame::Example::AnyUniqueAliasesUnion any_unique{}; @@ -1305,7 +1305,7 @@ struct MonsterT : public ::flatbuffers::NativeTable { std::vector<MyGame::Example::Color> vector_of_enums{}; MyGame::Example::Race signed_enum = MyGame::Example::Race_None; std::vector<uint8_t> testrequirednestedflatbuffer{}; - std::vector<flatbuffers::unique_ptr<MyGame::Example::StatT>> scalar_key_sorted_tables{}; + std::vector<std::unique_ptr<MyGame::Example::StatT>> scalar_key_sorted_tables{}; MyGame::Example::Test native_inline{}; MyGame::Example::LongEnum long_enum_non_enum_default = static_cast<MyGame::Example::LongEnum>(0); MyGame::Example::LongEnum long_enum_normal_default = MyGame::Example::LongEnum_LongOne; @@ -2861,7 +2861,7 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.test == rhs.test) && (lhs.test4 == rhs.test4) && (lhs.testarrayofstring == rhs.testarrayofstring) && - (lhs.testarrayoftables.size() == rhs.testarrayoftables.size() && std::equal(lhs.testarrayoftables.cbegin(), lhs.testarrayoftables.cend(), rhs.testarrayoftables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::MonsterT> const &a, flatbuffers::unique_ptr<MyGame::Example::MonsterT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.testarrayoftables.size() == rhs.testarrayoftables.size() && std::equal(lhs.testarrayoftables.cbegin(), lhs.testarrayoftables.cend(), rhs.testarrayoftables.cbegin(), [](std::unique_ptr<MyGame::Example::MonsterT> const &a, std::unique_ptr<MyGame::Example::MonsterT> const &b) { return (a == b) || (a && b && *a == *b); })) && ((lhs.enemy == rhs.enemy) || (lhs.enemy && rhs.enemy && *lhs.enemy == *rhs.enemy)) && (lhs.testnestedflatbuffer == rhs.testnestedflatbuffer) && ((lhs.testempty == rhs.testempty) || (lhs.testempty && rhs.testempty && *lhs.testempty == *rhs.testempty)) && @@ -2885,10 +2885,10 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.vector_of_longs == rhs.vector_of_longs) && (lhs.vector_of_doubles == rhs.vector_of_doubles) && ((lhs.parent_namespace_test == rhs.parent_namespace_test) || (lhs.parent_namespace_test && rhs.parent_namespace_test && *lhs.parent_namespace_test == *rhs.parent_namespace_test)) && - (lhs.vector_of_referrables.size() == rhs.vector_of_referrables.size() && std::equal(lhs.vector_of_referrables.cbegin(), lhs.vector_of_referrables.cend(), rhs.vector_of_referrables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &a, flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.vector_of_referrables.size() == rhs.vector_of_referrables.size() && std::equal(lhs.vector_of_referrables.cbegin(), lhs.vector_of_referrables.cend(), rhs.vector_of_referrables.cbegin(), [](std::unique_ptr<MyGame::Example::ReferrableT> const &a, std::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.single_weak_reference == rhs.single_weak_reference) && (lhs.vector_of_weak_references == rhs.vector_of_weak_references) && - (lhs.vector_of_strong_referrables.size() == rhs.vector_of_strong_referrables.size() && std::equal(lhs.vector_of_strong_referrables.cbegin(), lhs.vector_of_strong_referrables.cend(), rhs.vector_of_strong_referrables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &a, flatbuffers::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.vector_of_strong_referrables.size() == rhs.vector_of_strong_referrables.size() && std::equal(lhs.vector_of_strong_referrables.cbegin(), lhs.vector_of_strong_referrables.cend(), rhs.vector_of_strong_referrables.cbegin(), [](std::unique_ptr<MyGame::Example::ReferrableT> const &a, std::unique_ptr<MyGame::Example::ReferrableT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.co_owning_reference == rhs.co_owning_reference) && (lhs.vector_of_co_owning_references == rhs.vector_of_co_owning_references) && (lhs.non_owning_reference == rhs.non_owning_reference) && @@ -2898,7 +2898,7 @@ inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { (lhs.vector_of_enums == rhs.vector_of_enums) && (lhs.signed_enum == rhs.signed_enum) && (lhs.testrequirednestedflatbuffer == rhs.testrequirednestedflatbuffer) && - (lhs.scalar_key_sorted_tables.size() == rhs.scalar_key_sorted_tables.size() && std::equal(lhs.scalar_key_sorted_tables.cbegin(), lhs.scalar_key_sorted_tables.cend(), rhs.scalar_key_sorted_tables.cbegin(), [](flatbuffers::unique_ptr<MyGame::Example::StatT> const &a, flatbuffers::unique_ptr<MyGame::Example::StatT> const &b) { return (a == b) || (a && b && *a == *b); })) && + (lhs.scalar_key_sorted_tables.size() == rhs.scalar_key_sorted_tables.size() && std::equal(lhs.scalar_key_sorted_tables.cbegin(), lhs.scalar_key_sorted_tables.cend(), rhs.scalar_key_sorted_tables.cbegin(), [](std::unique_ptr<MyGame::Example::StatT> const &a, std::unique_ptr<MyGame::Example::StatT> const &b) { return (a == b) || (a && b && *a == *b); })) && (lhs.native_inline == rhs.native_inline) && (lhs.long_enum_non_enum_default == rhs.long_enum_non_enum_default) && (lhs.long_enum_normal_default == rhs.long_enum_normal_default) && @@ -3054,7 +3054,7 @@ inline MonsterT *Monster::UnPack(const ::flatbuffers::resolver_function_t *_reso inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = pos(); if (_e) _o->pos = flatbuffers::unique_ptr<MyGame::Example::Vec3>(new MyGame::Example::Vec3(*_e)); } + { auto _e = pos(); if (_e) _o->pos = std::unique_ptr<MyGame::Example::Vec3>(new MyGame::Example::Vec3(*_e)); } { auto _e = mana(); _o->mana = _e; } { auto _e = hp(); _o->hp = _e; } { auto _e = name(); if (_e) _o->name = _e->str(); } @@ -3064,10 +3064,10 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = test(); if (_e) _o->test.value = MyGame::Example::AnyUnion::UnPack(_e, test_type(), _resolver); } { auto _e = test4(); if (_e) { _o->test4.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->test4[_i] = *_e->Get(_i); } } else { _o->test4.resize(0); } } { auto _e = testarrayofstring(); if (_e) { _o->testarrayofstring.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->testarrayofstring[_i] = _e->Get(_i)->str(); } } else { _o->testarrayofstring.resize(0); } } - { auto _e = testarrayoftables(); if (_e) { _o->testarrayoftables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->testarrayoftables[_i]) { _e->Get(_i)->UnPackTo(_o->testarrayoftables[_i].get(), _resolver); } else { _o->testarrayoftables[_i] = flatbuffers::unique_ptr<MyGame::Example::MonsterT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->testarrayoftables.resize(0); } } - { auto _e = enemy(); if (_e) { if(_o->enemy) { _e->UnPackTo(_o->enemy.get(), _resolver); } else { _o->enemy = flatbuffers::unique_ptr<MyGame::Example::MonsterT>(_e->UnPack(_resolver)); } } else if (_o->enemy) { _o->enemy.reset(); } } + { auto _e = testarrayoftables(); if (_e) { _o->testarrayoftables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->testarrayoftables[_i]) { _e->Get(_i)->UnPackTo(_o->testarrayoftables[_i].get(), _resolver); } else { _o->testarrayoftables[_i] = std::unique_ptr<MyGame::Example::MonsterT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->testarrayoftables.resize(0); } } + { auto _e = enemy(); if (_e) { if(_o->enemy) { _e->UnPackTo(_o->enemy.get(), _resolver); } else { _o->enemy = std::unique_ptr<MyGame::Example::MonsterT>(_e->UnPack(_resolver)); } } else if (_o->enemy) { _o->enemy.reset(); } } { auto _e = testnestedflatbuffer(); if (_e) { _o->testnestedflatbuffer.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->testnestedflatbuffer.begin()); } } - { auto _e = testempty(); if (_e) { if(_o->testempty) { _e->UnPackTo(_o->testempty.get(), _resolver); } else { _o->testempty = flatbuffers::unique_ptr<MyGame::Example::StatT>(_e->UnPack(_resolver)); } } else if (_o->testempty) { _o->testempty.reset(); } } + { auto _e = testempty(); if (_e) { if(_o->testempty) { _e->UnPackTo(_o->testempty.get(), _resolver); } else { _o->testempty = std::unique_ptr<MyGame::Example::StatT>(_e->UnPack(_resolver)); } } else if (_o->testempty) { _o->testempty.reset(); } } { auto _e = testbool(); _o->testbool = _e; } { auto _e = testhashs32_fnv1(); _o->testhashs32_fnv1 = _e; } { auto _e = testhashu32_fnv1(); _o->testhashu32_fnv1 = _e; } @@ -3087,11 +3087,11 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = test5(); if (_e) { _o->test5.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->test5[_i] = *_e->Get(_i); } } else { _o->test5.resize(0); } } { auto _e = vector_of_longs(); if (_e) { _o->vector_of_longs.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_longs[_i] = _e->Get(_i); } } else { _o->vector_of_longs.resize(0); } } { auto _e = vector_of_doubles(); if (_e) { _o->vector_of_doubles.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_doubles[_i] = _e->Get(_i); } } else { _o->vector_of_doubles.resize(0); } } - { auto _e = parent_namespace_test(); if (_e) { if(_o->parent_namespace_test) { _e->UnPackTo(_o->parent_namespace_test.get(), _resolver); } else { _o->parent_namespace_test = flatbuffers::unique_ptr<MyGame::InParentNamespaceT>(_e->UnPack(_resolver)); } } else if (_o->parent_namespace_test) { _o->parent_namespace_test.reset(); } } - { auto _e = vector_of_referrables(); if (_e) { _o->vector_of_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_referrables[_i].get(), _resolver); } else { _o->vector_of_referrables[_i] = flatbuffers::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_referrables.resize(0); } } + { auto _e = parent_namespace_test(); if (_e) { if(_o->parent_namespace_test) { _e->UnPackTo(_o->parent_namespace_test.get(), _resolver); } else { _o->parent_namespace_test = std::unique_ptr<MyGame::InParentNamespaceT>(_e->UnPack(_resolver)); } } else if (_o->parent_namespace_test) { _o->parent_namespace_test.reset(); } } + { auto _e = vector_of_referrables(); if (_e) { _o->vector_of_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_referrables[_i].get(), _resolver); } else { _o->vector_of_referrables[_i] = std::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_referrables.resize(0); } } { auto _e = single_weak_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->single_weak_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->single_weak_reference = nullptr; } { auto _e = vector_of_weak_references(); if (_e) { _o->vector_of_weak_references.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { /*vector resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_weak_references[_i]), static_cast<::flatbuffers::hash_value_t>(_e->Get(_i))); else _o->vector_of_weak_references[_i] = nullptr; } } else { _o->vector_of_weak_references.resize(0); } } - { auto _e = vector_of_strong_referrables(); if (_e) { _o->vector_of_strong_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_strong_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_strong_referrables[_i].get(), _resolver); } else { _o->vector_of_strong_referrables[_i] = flatbuffers::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_strong_referrables.resize(0); } } + { auto _e = vector_of_strong_referrables(); if (_e) { _o->vector_of_strong_referrables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->vector_of_strong_referrables[_i]) { _e->Get(_i)->UnPackTo(_o->vector_of_strong_referrables[_i].get(), _resolver); } else { _o->vector_of_strong_referrables[_i] = std::unique_ptr<MyGame::Example::ReferrableT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->vector_of_strong_referrables.resize(0); } } { auto _e = co_owning_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->co_owning_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->co_owning_reference = nullptr; } { auto _e = vector_of_co_owning_references(); if (_e) { _o->vector_of_co_owning_references.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { /*vector resolver, default_ptr_type*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_co_owning_references[_i]), static_cast<::flatbuffers::hash_value_t>(_e->Get(_i)));/* else do nothing */; } } else { _o->vector_of_co_owning_references.resize(0); } } { auto _e = non_owning_reference(); /*scalar resolver, naked*/ if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->non_owning_reference), static_cast<::flatbuffers::hash_value_t>(_e)); else _o->non_owning_reference = nullptr; } @@ -3103,7 +3103,7 @@ inline void Monster::UnPackTo(MonsterT *_o, const ::flatbuffers::resolver_functi { auto _e = vector_of_enums(); if (_e) { _o->vector_of_enums.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_enums[_i] = static_cast<MyGame::Example::Color>(_e->Get(_i)); } } else { _o->vector_of_enums.resize(0); } } { auto _e = signed_enum(); _o->signed_enum = _e; } { auto _e = testrequirednestedflatbuffer(); if (_e) { _o->testrequirednestedflatbuffer.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->testrequirednestedflatbuffer.begin()); } } - { auto _e = scalar_key_sorted_tables(); if (_e) { _o->scalar_key_sorted_tables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->scalar_key_sorted_tables[_i]) { _e->Get(_i)->UnPackTo(_o->scalar_key_sorted_tables[_i].get(), _resolver); } else { _o->scalar_key_sorted_tables[_i] = flatbuffers::unique_ptr<MyGame::Example::StatT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->scalar_key_sorted_tables.resize(0); } } + { auto _e = scalar_key_sorted_tables(); if (_e) { _o->scalar_key_sorted_tables.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->scalar_key_sorted_tables[_i]) { _e->Get(_i)->UnPackTo(_o->scalar_key_sorted_tables[_i].get(), _resolver); } else { _o->scalar_key_sorted_tables[_i] = std::unique_ptr<MyGame::Example::StatT>(_e->Get(_i)->UnPack(_resolver)); }; } } else { _o->scalar_key_sorted_tables.resize(0); } } { auto _e = native_inline(); if (_e) _o->native_inline = *_e; } { auto _e = long_enum_non_enum_default(); _o->long_enum_non_enum_default = _e; } { auto _e = long_enum_normal_default(); _o->long_enum_normal_default = _e; } @@ -4214,16 +4214,16 @@ inline void FinishSizePrefixedMonsterBuffer( fbb.FinishSizePrefixed(root, MonsterIdentifier()); } -inline flatbuffers::unique_ptr<MyGame::Example::MonsterT> UnPackMonster( +inline std::unique_ptr<MyGame::Example::MonsterT> UnPackMonster( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::Example::MonsterT>(GetMonster(buf)->UnPack(res)); + return std::unique_ptr<MyGame::Example::MonsterT>(GetMonster(buf)->UnPack(res)); } -inline flatbuffers::unique_ptr<MyGame::Example::MonsterT> UnPackSizePrefixedMonster( +inline std::unique_ptr<MyGame::Example::MonsterT> UnPackSizePrefixedMonster( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MyGame::Example::MonsterT>(GetSizePrefixedMonster(buf)->UnPack(res)); + return std::unique_ptr<MyGame::Example::MonsterT>(GetSizePrefixedMonster(buf)->UnPack(res)); } } // namespace Example diff --git a/tests/namespace_test/namespace_test2_generated.h b/tests/namespace_test/namespace_test2_generated.h index 212d0f1e..d59355df 100644 --- a/tests/namespace_test/namespace_test2_generated.h +++ b/tests/namespace_test/namespace_test2_generated.h @@ -69,10 +69,10 @@ struct TableInFirstNST : public ::flatbuffers::NativeTable { static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { return "NamespaceA.TableInFirstNST"; } - flatbuffers::unique_ptr<NamespaceA::NamespaceB::TableInNestedNST> foo_table{}; + std::unique_ptr<NamespaceA::NamespaceB::TableInNestedNST> foo_table{}; NamespaceA::NamespaceB::EnumInNestedNS foo_enum = NamespaceA::NamespaceB::EnumInNestedNS_A; NamespaceA::NamespaceB::UnionInNestedNSUnion foo_union{}; - flatbuffers::unique_ptr<NamespaceA::NamespaceB::StructInNestedNS> foo_struct{}; + std::unique_ptr<NamespaceA::NamespaceB::StructInNestedNS> foo_struct{}; TableInFirstNST() = default; TableInFirstNST(const TableInFirstNST &o); TableInFirstNST(TableInFirstNST&&) FLATBUFFERS_NOEXCEPT = default; @@ -203,8 +203,8 @@ struct TableInCT : public ::flatbuffers::NativeTable { static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { return "NamespaceC.TableInCT"; } - flatbuffers::unique_ptr<NamespaceA::TableInFirstNST> refer_to_a1{}; - flatbuffers::unique_ptr<NamespaceA::SecondTableInAT> refer_to_a2{}; + std::unique_ptr<NamespaceA::TableInFirstNST> refer_to_a1{}; + std::unique_ptr<NamespaceA::SecondTableInAT> refer_to_a2{}; TableInCT() = default; TableInCT(const TableInCT &o); TableInCT(TableInCT&&) FLATBUFFERS_NOEXCEPT = default; @@ -291,7 +291,7 @@ struct SecondTableInAT : public ::flatbuffers::NativeTable { static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { return "NamespaceA.SecondTableInAT"; } - flatbuffers::unique_ptr<NamespaceC::TableInCT> refer_to_c{}; + std::unique_ptr<NamespaceC::TableInCT> refer_to_c{}; SecondTableInAT() = default; SecondTableInAT(const SecondTableInAT &o); SecondTableInAT(SecondTableInAT&&) FLATBUFFERS_NOEXCEPT = default; @@ -393,11 +393,11 @@ inline TableInFirstNST *TableInFirstNS::UnPack(const ::flatbuffers::resolver_fun inline void TableInFirstNS::UnPackTo(TableInFirstNST *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = foo_table(); if (_e) { if(_o->foo_table) { _e->UnPackTo(_o->foo_table.get(), _resolver); } else { _o->foo_table = flatbuffers::unique_ptr<NamespaceA::NamespaceB::TableInNestedNST>(_e->UnPack(_resolver)); } } else if (_o->foo_table) { _o->foo_table.reset(); } } + { auto _e = foo_table(); if (_e) { if(_o->foo_table) { _e->UnPackTo(_o->foo_table.get(), _resolver); } else { _o->foo_table = std::unique_ptr<NamespaceA::NamespaceB::TableInNestedNST>(_e->UnPack(_resolver)); } } else if (_o->foo_table) { _o->foo_table.reset(); } } { auto _e = foo_enum(); _o->foo_enum = _e; } { auto _e = foo_union_type(); _o->foo_union.type = _e; } { auto _e = foo_union(); if (_e) _o->foo_union.value = NamespaceA::NamespaceB::UnionInNestedNSUnion::UnPack(_e, foo_union_type(), _resolver); } - { auto _e = foo_struct(); if (_e) _o->foo_struct = flatbuffers::unique_ptr<NamespaceA::NamespaceB::StructInNestedNS>(new NamespaceA::NamespaceB::StructInNestedNS(*_e)); } + { auto _e = foo_struct(); if (_e) _o->foo_struct = std::unique_ptr<NamespaceA::NamespaceB::StructInNestedNS>(new NamespaceA::NamespaceB::StructInNestedNS(*_e)); } } inline ::flatbuffers::Offset<TableInFirstNS> TableInFirstNS::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const TableInFirstNST* _o, const ::flatbuffers::rehasher_function_t *_rehasher) { @@ -458,8 +458,8 @@ inline TableInCT *TableInC::UnPack(const ::flatbuffers::resolver_function_t *_re inline void TableInC::UnPackTo(TableInCT *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = refer_to_a1(); if (_e) { if(_o->refer_to_a1) { _e->UnPackTo(_o->refer_to_a1.get(), _resolver); } else { _o->refer_to_a1 = flatbuffers::unique_ptr<NamespaceA::TableInFirstNST>(_e->UnPack(_resolver)); } } else if (_o->refer_to_a1) { _o->refer_to_a1.reset(); } } - { auto _e = refer_to_a2(); if (_e) { if(_o->refer_to_a2) { _e->UnPackTo(_o->refer_to_a2.get(), _resolver); } else { _o->refer_to_a2 = flatbuffers::unique_ptr<NamespaceA::SecondTableInAT>(_e->UnPack(_resolver)); } } else if (_o->refer_to_a2) { _o->refer_to_a2.reset(); } } + { auto _e = refer_to_a1(); if (_e) { if(_o->refer_to_a1) { _e->UnPackTo(_o->refer_to_a1.get(), _resolver); } else { _o->refer_to_a1 = std::unique_ptr<NamespaceA::TableInFirstNST>(_e->UnPack(_resolver)); } } else if (_o->refer_to_a1) { _o->refer_to_a1.reset(); } } + { auto _e = refer_to_a2(); if (_e) { if(_o->refer_to_a2) { _e->UnPackTo(_o->refer_to_a2.get(), _resolver); } else { _o->refer_to_a2 = std::unique_ptr<NamespaceA::SecondTableInAT>(_e->UnPack(_resolver)); } } else if (_o->refer_to_a2) { _o->refer_to_a2.reset(); } } } inline ::flatbuffers::Offset<TableInC> TableInC::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const TableInCT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) { @@ -511,7 +511,7 @@ inline SecondTableInAT *SecondTableInA::UnPack(const ::flatbuffers::resolver_fun inline void SecondTableInA::UnPackTo(SecondTableInAT *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = refer_to_c(); if (_e) { if(_o->refer_to_c) { _e->UnPackTo(_o->refer_to_c.get(), _resolver); } else { _o->refer_to_c = flatbuffers::unique_ptr<NamespaceC::TableInCT>(_e->UnPack(_resolver)); } } else if (_o->refer_to_c) { _o->refer_to_c.reset(); } } + { auto _e = refer_to_c(); if (_e) { if(_o->refer_to_c) { _e->UnPackTo(_o->refer_to_c.get(), _resolver); } else { _o->refer_to_c = std::unique_ptr<NamespaceC::TableInCT>(_e->UnPack(_resolver)); } } else if (_o->refer_to_c) { _o->refer_to_c.reset(); } } } inline ::flatbuffers::Offset<SecondTableInA> SecondTableInA::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const SecondTableInAT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) { diff --git a/tests/native_inline_table_test_generated.h b/tests/native_inline_table_test_generated.h index aabd99ab..7c025a69 100644 --- a/tests/native_inline_table_test_generated.h +++ b/tests/native_inline_table_test_generated.h @@ -214,7 +214,7 @@ inline TestNativeInlineTableT *TestNativeInlineTable::UnPack(const ::flatbuffers inline void TestNativeInlineTable::UnPackTo(TestNativeInlineTableT *_o, const ::flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; - { auto _e = t(); if (_e) { _o->t.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->t[_i] = *flatbuffers::unique_ptr<NativeInlineTableT>(_e->Get(_i)->UnPack(_resolver)); } } else { _o->t.resize(0); } } + { auto _e = t(); if (_e) { _o->t.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->t[_i] = *std::unique_ptr<NativeInlineTableT>(_e->Get(_i)->UnPack(_resolver)); } } else { _o->t.resize(0); } } } inline ::flatbuffers::Offset<TestNativeInlineTable> TestNativeInlineTable::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const TestNativeInlineTableT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) { diff --git a/tests/native_type_test_generated.h b/tests/native_type_test_generated.h index 062176b2..6c3534be 100644 --- a/tests/native_type_test_generated.h +++ b/tests/native_type_test_generated.h @@ -321,16 +321,16 @@ inline void FinishSizePrefixedApplicationDataBuffer( fbb.FinishSizePrefixed(root); } -inline flatbuffers::unique_ptr<Geometry::ApplicationDataT> UnPackApplicationData( +inline std::unique_ptr<Geometry::ApplicationDataT> UnPackApplicationData( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<Geometry::ApplicationDataT>(GetApplicationData(buf)->UnPack(res)); + return std::unique_ptr<Geometry::ApplicationDataT>(GetApplicationData(buf)->UnPack(res)); } -inline flatbuffers::unique_ptr<Geometry::ApplicationDataT> UnPackSizePrefixedApplicationData( +inline std::unique_ptr<Geometry::ApplicationDataT> UnPackSizePrefixedApplicationData( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<Geometry::ApplicationDataT>(GetSizePrefixedApplicationData(buf)->UnPack(res)); + return std::unique_ptr<Geometry::ApplicationDataT>(GetSizePrefixedApplicationData(buf)->UnPack(res)); } } // namespace Geometry diff --git a/tests/optional_scalars_generated.h b/tests/optional_scalars_generated.h index 40a3c91c..3cfc19c3 100644 --- a/tests/optional_scalars_generated.h +++ b/tests/optional_scalars_generated.h @@ -944,16 +944,16 @@ inline void FinishSizePrefixedScalarStuffBuffer( fbb.FinishSizePrefixed(root, ScalarStuffIdentifier()); } -inline flatbuffers::unique_ptr<optional_scalars::ScalarStuffT> UnPackScalarStuff( +inline std::unique_ptr<optional_scalars::ScalarStuffT> UnPackScalarStuff( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<optional_scalars::ScalarStuffT>(GetScalarStuff(buf)->UnPack(res)); + return std::unique_ptr<optional_scalars::ScalarStuffT>(GetScalarStuff(buf)->UnPack(res)); } -inline flatbuffers::unique_ptr<optional_scalars::ScalarStuffT> UnPackSizePrefixedScalarStuff( +inline std::unique_ptr<optional_scalars::ScalarStuffT> UnPackSizePrefixedScalarStuff( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<optional_scalars::ScalarStuffT>(GetSizePrefixedScalarStuff(buf)->UnPack(res)); + return std::unique_ptr<optional_scalars::ScalarStuffT>(GetSizePrefixedScalarStuff(buf)->UnPack(res)); } } // namespace optional_scalars diff --git a/tests/union_vector/union_vector_generated.h b/tests/union_vector/union_vector_generated.h index d1d06aaa..b44d7241 100644 --- a/tests/union_vector/union_vector_generated.h +++ b/tests/union_vector/union_vector_generated.h @@ -1274,16 +1274,16 @@ inline void FinishSizePrefixedMovieBuffer( fbb.FinishSizePrefixed(root, MovieIdentifier()); } -inline flatbuffers::unique_ptr<MovieT> UnPackMovie( +inline std::unique_ptr<MovieT> UnPackMovie( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MovieT>(GetMovie(buf)->UnPack(res)); + return std::unique_ptr<MovieT>(GetMovie(buf)->UnPack(res)); } -inline flatbuffers::unique_ptr<MovieT> UnPackSizePrefixedMovie( +inline std::unique_ptr<MovieT> UnPackSizePrefixedMovie( const void *buf, const ::flatbuffers::resolver_function_t *res = nullptr) { - return flatbuffers::unique_ptr<MovieT>(GetSizePrefixedMovie(buf)->UnPack(res)); + return std::unique_ptr<MovieT>(GetSizePrefixedMovie(buf)->UnPack(res)); } #endif // FLATBUFFERS_GENERATED_UNIONVECTOR_H_ |