| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #include <fidl/test.unionsandwich/cpp/natural_types.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| ::test_unionsandwich::SandwichUnionSize8Alignment4::Storage_ test_unionsandwich::SandwichUnionSize8Alignment4::CloneStorage_() const { |
| return Storage_{ |
| ::fidl::internal::NaturalClone(storage_.before), |
| ::fidl::internal::NaturalClone(storage_.union_), |
| ::fidl::internal::NaturalClone(storage_.after)}; |
| } |
| |
| ::test_unionsandwich::SandwichUnionSize12Alignment4::Storage_ test_unionsandwich::SandwichUnionSize12Alignment4::CloneStorage_() const { |
| return Storage_{ |
| ::fidl::internal::NaturalClone(storage_.before), |
| ::fidl::internal::NaturalClone(storage_.union_), |
| ::fidl::internal::NaturalClone(storage_.after)}; |
| } |
| |
| ::test_unionsandwich::StructSize16Alignment8::Storage_ test_unionsandwich::StructSize16Alignment8::CloneStorage_() const { |
| return Storage_{ |
| ::fidl::internal::NaturalClone(storage_.f1), |
| ::fidl::internal::NaturalClone(storage_.f2)}; |
| } |
| |
| ::test_unionsandwich::SandwichUnionSize24Alignment8::Storage_ test_unionsandwich::SandwichUnionSize24Alignment8::CloneStorage_() const { |
| return Storage_{ |
| ::fidl::internal::NaturalClone(storage_.before), |
| ::fidl::internal::NaturalClone(storage_.union_), |
| ::fidl::internal::NaturalClone(storage_.after)}; |
| } |
| |
| ::test_unionsandwich::SandwichUnionSize36Alignment4::Storage_ test_unionsandwich::SandwichUnionSize36Alignment4::CloneStorage_() const { |
| return Storage_{ |
| ::fidl::internal::NaturalClone(storage_.before), |
| ::fidl::internal::NaturalClone(storage_.union_), |
| ::fidl::internal::NaturalClone(storage_.after)}; |
| } |
| |
| std::shared_ptr<::test_unionsandwich::UnionSize8Alignment4::Storage_> test_unionsandwich::UnionSize8Alignment4::CloneStorage_() const { |
| const Storage_& storage = *storage_; |
| switch (storage_->index()) { |
| case 1: |
| return std::make_shared<Storage_>( |
| std::in_place_index<1>, |
| ::fidl::internal::NaturalClone(std::get<1>(storage))); |
| default: |
| return std::make_shared<Storage_>(); |
| } |
| } |
| |
| std::shared_ptr<::test_unionsandwich::UnionSize12Alignment4::Storage_> test_unionsandwich::UnionSize12Alignment4::CloneStorage_() const { |
| const Storage_& storage = *storage_; |
| switch (storage_->index()) { |
| case 1: |
| return std::make_shared<Storage_>( |
| std::in_place_index<1>, |
| ::fidl::internal::NaturalClone(std::get<1>(storage))); |
| default: |
| return std::make_shared<Storage_>(); |
| } |
| } |
| |
| std::shared_ptr<::test_unionsandwich::UnionSize24Alignment8::Storage_> test_unionsandwich::UnionSize24Alignment8::CloneStorage_() const { |
| const Storage_& storage = *storage_; |
| switch (storage_->index()) { |
| case 1: |
| return std::make_shared<Storage_>( |
| std::in_place_index<1>, |
| ::fidl::internal::NaturalClone(std::get<1>(storage))); |
| default: |
| return std::make_shared<Storage_>(); |
| } |
| } |
| |
| std::shared_ptr<::test_unionsandwich::UnionSize36Alignment4::Storage_> test_unionsandwich::UnionSize36Alignment4::CloneStorage_() const { |
| const Storage_& storage = *storage_; |
| switch (storage_->index()) { |
| case 1: |
| return std::make_shared<Storage_>( |
| std::in_place_index<1>, |
| ::fidl::internal::NaturalClone(std::get<1>(storage))); |
| default: |
| return std::make_shared<Storage_>(); |
| } |
| } |
| |
| #pragma clang diagnostic pop |