pax_global_header00006660000000000000000000000064143464446530014527gustar00rootroot0000000000000052 comment=fc8f6e8346c4fc8a5440b97045de10271e0ab94e libsigmf-1.0.2/000077500000000000000000000000001434644465300133235ustar00rootroot00000000000000libsigmf-1.0.2/.gitignore000066400000000000000000000000361434644465300153120ustar00rootroot00000000000000*build* .idea/ .vscode/ site/ libsigmf-1.0.2/.gitlab-ci.yml000066400000000000000000000031541434644465300157620ustar00rootroot00000000000000 stages: - build - check - deploy build-16.04: stage: build image: ubuntu:16.04 before_script: - apt update && apt install -y cmake build-essential git - git submodule update --init --recursive script: - mkdir build && cd build - cmake .. - make - ./example artifacts: paths: - build reports: performance: - performance.json expire_in: 1 week build-18.04: stage: build image: ubuntu:18.04 before_script: - apt update && apt install -y cmake build-essential git - git submodule update --init --recursive script: - mkdir build && cd build - cmake .. - make - ./example artifacts: paths: - build expire_in: 1 week test-16.04: stage: check dependencies: - build-16.04 image: ubuntu:16.04 before_script: - apt update && apt install -y valgrind script: - valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all build/example test-18.04: stage: check dependencies: - build-18.04 image: ubuntu:18.04 before_script: - apt update && apt install -y valgrind script: - valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all build/example pages: stage: deploy image: python:alpine before_script: - pip install mkdocs script: - mkdocs build - mv site public artifacts: paths: - public only: - master libsigmf-1.0.2/.gitmodules000066400000000000000000000003171434644465300155010ustar00rootroot00000000000000[submodule "external/json"] path = external/json url = https://github.com/nlohmann/json.git [submodule "external/flatbuffers"] path = external/flatbuffers url = https://github.com/google/flatbuffers.git libsigmf-1.0.2/ABOUT000066400000000000000000000007311434644465300141210ustar00rootroot00000000000000libsigmf: https://www.deepsig.io/libsigmf libsigmf is a free & opensource library for working with SigMF recordings. (https://sigmf.org) It was designed to enable the use of SigMF through static types in C++, thus enabling things like compile-time errors and code inspection. It was created and first authored by DeepSig Inc., and then released to the community as an Apache 2.0-licensed FOSS project at FOSDEM 2019. Contributors: Nathan West Tim O'Shea Ben Hilburn libsigmf-1.0.2/CMakeLists.txt000066400000000000000000000234061434644465300160700ustar00rootroot00000000000000 ######################################################################## # Setup project ######################################################################## cmake_minimum_required(VERSION 3.0) project(libsigmf VERSION 1.0.2 LANGUAGES CXX) # c++17 used for supporting flatbuffers optional scalar fields via std::optional set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) list(APPEND CMAKE_MODULE_PATH cmake) option(ENABLE_EXAMPLES "Enable building of examples" ON) option(USE_SYSTEM_JSON "Attempt to use the system installed nlohmann JSON library" OFF) option(USE_SYSTEM_FLATBUFFERS "Attempt to use the system installed flatbuffers library and flatc" OFF) include(GNUInstallDirs) set(LIBSIGMF_TARGET_NAME ${PROJECT_NAME}) set(LIBSIGMF_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE INTERNAL "") set(LIBSIGMF_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}") set(LIBSIGMF_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") set(LIBSIGMF_CMAKE_CONFIG_TEMPLATE "cmake/config.cmake.in") set(LIBSIGMF_CMAKE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}") set(LIBSIGMF_CMAKE_PROJECT_CONFIG_FILE "${LIBSIGMF_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Config.cmake") set(LIBSIGMF_CMAKE_VERSION_CONFIG_FILE "${LIBSIGMF_CMAKE_CONFIG_DIR}/${PROJECT_NAME}ConfigVersion.cmake") set(LIBSIGMF_CMAKE_PROJECT_TARGETS_FILE "${LIBSIGMF_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Targets.cmake") ######################################################################## # Dependency management # # Prefer system-installed versions, but revert to using submodules ######################################################################## set(libsigmf_deps "") # flatbuffers if (${USE_SYSTEM_FLATBUFFERS}) find_package(Flatbuffers REQUIRED) endif (${USE_SYSTEM_FLATBUFFERS}) if (NOT ${USE_SYSTEM_FLATBUFFERS}) message(STATUS "Flatbuffers was not found. Submodule will be used. This will require building flatc") set(FLATBUFFERS_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/flatbuffers/include") # Initialize Flatbuffers submodule if unititialized set(FLATBUFFERS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/flatbuffers/include CACHE PATH "flatbuffers include directory") if (NOT IS_DIRECTORY ${FLATBUFFERS_INCLUDE_DIR}) message("Flatbuffers submodule not found! Downloading...") execute_process(COMMAND git submodule update --init -- external/flatbuffers WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endif(NOT IS_DIRECTORY ${FLATBUFFERS_INCLUDE_DIR}) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/flatbuffers ${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build EXCLUDE_FROM_ALL) endif (NOT ${USE_SYSTEM_FLATBUFFERS}) # nlohmann_json if (${USE_SYSTEM_JSON}) find_package(nlohmann_json REQUIRED) endif (${USE_SYSTEM_JSON}) if (NOT ${USE_SYSTEM_JSON}) message(STATUS "Nlohmann JSON was not found. Submodule will be used.") # Initialize Json submodule if unititialized set(JSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/json/include CACHE PATH "json include directory") if (NOT IS_DIRECTORY ${JSON_INCLUDE_DIR}) message("Json submodule not found! Downloading...") execute_process(COMMAND git submodule update --init -- external/json WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endif(NOT IS_DIRECTORY ${JSON_INCLUDE_DIR}) endif(NOT ${USE_SYSTEM_JSON}) ######################################################################## # Use flatbuffers to generate SigMF headers ######################################################################## function(generate_sigmf_header generate_sigmf_target FBS_FILE OUTPUT_LOCATION) get_filename_component(generated_output_name ${FBS_FILE} NAME_WE) message(STATUS "Flatbuffers generated ${generated_output_name}") if( ${ARGC} GREATER 3) set(FLATC_EXTRA_ARGS ${ARGN}) string(REPLACE " " ";" FLATC_EXTRA_ARGS ${FLATC_EXTRA_ARGS}) else() set(FLATC_EXTRA_ARGS "") endif() add_custom_command(OUTPUT ${OUTPUT_LOCATION}/${generated_output_name}_generated.h COMMAND flatc ${FLATC_EXTRA_ARGS} -c --cpp-ptr-type std::shared_ptr --reflect-types --reflect-names --gen-object-api -o "${OUTPUT_LOCATION}/" "${FBS_FILE}" COMMENT "Building C++ header for flatbuffers definition ${FBS_FILE} ${ARGC} ${ARGN}" WORKING_DIRECTORY . DEPENDS "${FBS_FILE}" ) add_custom_target(generate_sigmf_target_${generate_sigmf_target} DEPENDS ${OUTPUT_LOCATION}/${generated_output_name}_generated.h ) add_library(${generate_sigmf_target} INTERFACE) add_dependencies(${generate_sigmf_target} generate_sigmf_target_${generate_sigmf_target} flatc) target_include_directories(${generate_sigmf_target} INTERFACE "${OUTPUT_LOCATION}/") endfunction(generate_sigmf_header) ######################################################################## # Create targets for generating default namespace definitions ######################################################################## generate_sigmf_header(generated_core_ns "${CMAKE_CURRENT_SOURCE_DIR}/sigmf_protocols/sigmf_core.fbs" "${CMAKE_CURRENT_BINARY_DIR}/include" ) generate_sigmf_header(generated_adsb_ns "${CMAKE_CURRENT_SOURCE_DIR}/sigmf_protocols/sigmf_adsb.fbs" "${CMAKE_CURRENT_BINARY_DIR}/include" ) generate_sigmf_header(generated_antenna_ns "${CMAKE_CURRENT_SOURCE_DIR}/sigmf_protocols/sigmf_antenna.fbs" "${CMAKE_CURRENT_BINARY_DIR}/include" ) generate_sigmf_header(generated_capture_details_ns "${CMAKE_CURRENT_SOURCE_DIR}/sigmf_protocols/sigmf_capture_details.fbs" "${CMAKE_CURRENT_BINARY_DIR}/include" ) generate_sigmf_header(generated_signal_ns "${CMAKE_CURRENT_SOURCE_DIR}/sigmf_protocols/sigmf_signal.fbs" "${CMAKE_CURRENT_BINARY_DIR}/include" ) generate_sigmf_header(generated_spatial_ns "${CMAKE_CURRENT_SOURCE_DIR}/sigmf_protocols/sigmf_spatial.fbs" "${CMAKE_CURRENT_BINARY_DIR}/include" ) generate_sigmf_header(generated_wifi_ns "${CMAKE_CURRENT_SOURCE_DIR}/sigmf_protocols/sigmf_wifi.fbs" "${CMAKE_CURRENT_BINARY_DIR}/include" ) generate_sigmf_header(generated_testing_ns "${CMAKE_CURRENT_SOURCE_DIR}/sigmf_protocols/testing_protocols.fbs" "${CMAKE_CURRENT_BINARY_DIR}/include" ) # We also carry around pre-generated headers so downstream doesn't need to build flatc set(LIBSIGMF_PREGEN_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/sigmf_protocols") ######################################################################## # Our interface target that downstream have to use ######################################################################## add_library(libsigmf INTERFACE) target_include_directories(libsigmf INTERFACE $ $ $ $ ) if (${Flatbuffers_FOUND}) # System flatbuffers can import this target else() target_include_directories(libsigmf INTERFACE $ ) endif(${Flatbuffers_FOUND}) if (${nlohmann_json_FOUND}) # TODO: add target_link_libraries interface to nlohmann json # when we use the system version else() target_include_directories(libsigmf INTERFACE $ ) endif(${nlohmann_json_FOUND}) ######################################################################## # Ensure that our protocol headers are generated before libsigmf dep ######################################################################## add_dependencies(libsigmf libsigmf_genheaders) add_custom_target(libsigmf_genheaders DEPENDS generate_sigmf_target_generated_core_ns # extension namespaces: generate_sigmf_target_generated_adsb_ns generate_sigmf_target_generated_antenna_ns generate_sigmf_target_generated_capture_details_ns generate_sigmf_target_generated_spatial_ns generate_sigmf_target_generated_signal_ns generate_sigmf_target_generated_wifi_ns generate_sigmf_target_generated_testing_ns ) if (ENABLE_EXAMPLES) add_subdirectory(examples) endif (ENABLE_EXAMPLES) add_custom_target(makedocs COMMAND mkdocs build COMMENT "Building documentation website" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) include(CMakePackageConfigHelpers) write_basic_package_version_file( ${LIBSIGMF_CMAKE_VERSION_CONFIG_FILE} COMPATIBILITY SameMajorVersion ) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${LIBSIGMF_CMAKE_CONFIG_TEMPLATE} ${LIBSIGMF_CMAKE_PROJECT_CONFIG_FILE} @ONLY ) ######################################################################## # Install SigMF headers ######################################################################## install( # install flatbuf proto defs DIRECTORY ${LIBSIGMF_PREGEN_HEADERS}/ DESTINATION include/sigmf/fbs FILES_MATCHING PATTERN "*.fbs") install( # install pregenerated headers DIRECTORY ${LIBSIGMF_PREGEN_HEADERS}/ DESTINATION include/sigmf FILES_MATCHING PATTERN "*.h") install( # if headers were built, replace pregenerated headers with those DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ DESTINATION include/sigmf FILES_MATCHING PATTERN "*.h") install( # install original headers DIRECTORY ${CMAKE_SOURCE_DIR}/src/ DESTINATION include/sigmf FILES_MATCHING PATTERN "*.h") ######################################################################## # Install cmake configuration foo ######################################################################## install( FILES ${LIBSIGMF_CMAKE_PROJECT_CONFIG_FILE} ${LIBSIGMF_CMAKE_VERSION_CONFIG_FILE} DESTINATION ${LIBSIGMF_CONFIG_INSTALL_DIR} ) install(TARGETS libsigmf EXPORT ${LIBSIGMF_TARGETS_EXPORT_NAME} ) install(EXPORT ${LIBSIGMF_TARGETS_EXPORT_NAME} FILE ${LIBSIGMF_TARGETS_EXPORT_NAME}.cmake NAMESPACE ${PROJECT_NAME}:: DESTINATION ${LIBSIGMF_CONFIG_INSTALL_DIR} ) libsigmf-1.0.2/CONTRIBUTING.md000066400000000000000000000006641434644465300155620ustar00rootroot00000000000000All contributions following the `inbound=outbound` licensing model, as described [here](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license), and are copyright of their respective author(s). When contributing code, please mimic the code style of the project. Contributions should be made in the form of Pull Requests on [libsigmf's GitHub project](https://github.com/deepsig/libsigmf). libsigmf-1.0.2/LICENSE000066400000000000000000000261371434644465300143410ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. libsigmf-1.0.2/NOTICE000066400000000000000000000011571434644465300142330ustar00rootroot00000000000000libsigmf: https://www.deepsig.io/libsigmf Copyright 2019 DeepSig Inc. and libsigmf contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. libsigmf-1.0.2/README.md000066400000000000000000000120111434644465300145750ustar00rootroot00000000000000 # libsigmf `libsigmf` is a header-only C++ library for working with [SigMF](https://github.com/gnuradio/sigmf) metadata. It is provided under the Apache License 2.0 and the copyright notice can be found in NOTICE. ## Updates in libsigmf v1.0 Version 1.0 has several changes from earlier versions, most notably is the requirement to use optional (nullable) scalar fields which became supported in flatbuffers since the library was originally published (v0.0.2). This means scalar values are ALL implemented as `std::optional`, which is a change for applications using `libsigmf`. This change was made to avoid the situation where default values are either not populated or always populated. Now all fields will be included in the output if and only if they are set. Other v1.0 changes include: updating to the latest SigMF metadata fields in the included schemas (including redefining all scalar fields as optional via `=null;`), updating to flatbuffers v2.0.0 syntax, using `shared_ptr` for generated headers instead of `unique_ptr`, cmake updates, updates to examples to ensure optional fields are working correctly, update to require c++17 for `std::optional`, and namespacing the entire library and associated schema files within the `sigmf::` c++ namespace. To update existing code from libsigmf v0.x to v1.x, some changes are required. Accessing a field like this: ```c++ annotation_sample_start = annotation.sample_start; ``` is no longer valid as the `annotation.sample_start` field is not a `uint64_t`, its a `std::optional` and must now be checked to see if it has been set, then accessed in a legal way, such as: ```c++ if (annotation.sample_start.has_value()) { annotation_sample_start = annotation.sample_start.value(); } else { // what to do if the "sample_start" field is missing } ``` Users can also preserve existing behavior (where all scalar fields had a default value of zero) with: ```c++ annotation_sample_start = annotation.sample_start.value_or(0); ``` or any other default value of choice. Generation of JSON is unaffected other than it is no longer required to choose between "all fields" or "no fields with default values". ## Limitations of libsigmf v1.0 - SigMF collections do not have any formal support yet. - Formal test code is still a WIP, examples provide some code coverage. ## Building libsigmf depends on the following packages: - nlohmann-json3-dev (3.7.3 preferred, other versions may work) - libflatbuffers-dev (2.0.0 required as of SigMF v1.0) These dependencies are included as submodules that can be built alongside libsigmf (default), or system installed libraries can be used by passing `-DUSE_SYSTEM_JSON=ON -DUSE_SYSTEM_FLATBUFFERS=ON` to cmake. It is recommended that users install flatbuffers v2.0 system wide as most applications using libsigmf will also need this. Build with the standard cmake process: ``` mkdir build cd build cmake ../ # OR: cmake -DUSE_SYSTEM_JSON=ON -DUSE_SYSTEM_FLATBUFFERS=ON ../ make -j sudo make install ``` ## Usage It is important to keep in mind that libsigmf does not strictly enforce all aspects of the SigMF specification. While types are strictly enforced, fields that are noted as REQUIRED by SigMF will not necessarily cause errors if they are missing during schema parsing. ### Including in your application To use libsigmf, your application needs to `#include ` and link to `libflatbuffers.so`. One option is to include libsigmf (this git repo) as a submodule inside your project sources. A typical cmake usage would look like the following (see the CMakeLists.txt in this examples directory for what this looks like in real usage). ```cmake add_executable(example_record_with_multiple_namespaces example_record_with_multiple_namespaces.cpp) target_link_libraries(example_record_with_multiple_namespaces libsigmf::libsigmf) target_include_directories(example_record_with_multiple_namespaces PRIVATE ${CMAKE_BINARY_DIR}/include) ``` Ideally you install `libsigmf` either system-wide or in a prefix. Provided CMake configuration then enables you to include `libsigmf` in your project by including this ```cmake find_package(libsigmf REQUIRED) add_executable(my_awesome_record my_awesome_record.cpp) target_link_libraries(my_awesome_record libsigmf::libsigmf) ``` ### Code usage libsigmf internally has a class `sigmf::VariadicDataClass` that does the heavy lifting of keeping objects of collected metadata using different SigMF namespaces. As a convenience, there are 4 classes that directly deal with SigMF objects that are all you need to use: 1) `sigmf::SigMF` 2) `sigmf::Global` 3) `sigmf::Capture` 4) `sigmf::Annotation` ## Extensions By default, the `antenna`, `capture_details`, and `signal` extensions are included in libsigmf. Users are able to add additional extensions by defining *.fbs schema, building with flatc and including these schema in their applications. The canonical signal-specific extensions (`adsb`, `wifi`) are included and imported into sigmf.h but are not built into the sigmf helpers by default. ## Contributing Please see `CONTRIBUTING.md` for more information! libsigmf-1.0.2/cmake/000077500000000000000000000000001434644465300144035ustar00rootroot00000000000000libsigmf-1.0.2/cmake/BuildFlatBuffers.cmake000066400000000000000000000137011434644465300205720ustar00rootroot00000000000000# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # General function to create FlatBuffer build rules for the given list of # schemas. # # flatbuffers_schemas: A list of flatbuffer schema files to process. # # schema_include_dirs: A list of schema file include directories, which will be # passed to flatc via the -I parameter. # # custom_target_name: The generated files will be added as dependencies for a # new custom target with this name. You should add that target as a dependency # for your main target to ensure these files are built. You can also retrieve # various properties from this target, such as GENERATED_INCLUDES_DIR, # BINARY_SCHEMAS_DIR, and COPY_TEXT_SCHEMAS_DIR. # # additional_dependencies: A list of additional dependencies that you'd like # all generated files to depend on. Pass in a blank string if you have none. # # generated_includes_dir: Where to generate the C++ header files for these # schemas. The generated includes directory will automatically be added to # CMake's include directories, and will be where generated header files are # placed. This parameter is optional; pass in empty string if you don't want to # generate include files for these schemas. # # binary_schemas_dir: If you specify an optional binary schema directory, binary # schemas will be generated for these schemas as well, and placed into the given # directory. # # copy_text_schemas_dir: If you want all text schemas (including schemas from # all schema include directories) copied into a directory (for example, if you # need them within your project to build JSON files), you can specify that # folder here. All text schemas will be copied to that folder. # # IMPORTANT: Make sure you quote all list arguments you pass to this function! # Otherwise CMake will only pass in the first element. # Example: build_flatbuffers("${fb_files}" "${include_dirs}" target_name ...) function(build_flatbuffers flatbuffers_schemas schema_include_dirs custom_target_name additional_dependencies generated_includes_dir binary_schemas_dir copy_text_schemas_dir) # Test if including from FindFlatBuffers if(FLATBUFFERS_FLATC_EXECUTABLE) set(FLATC_TARGET "") set(FLATC ${FLATBUFFERS_FLATC_EXECUTABLE}) else() set(FLATC_TARGET flatc) set(FLATC flatc) endif() set(FLATC_SCHEMA_ARGS --gen-mutable) if(FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS) set(FLATC_SCHEMA_ARGS ${FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS} ${FLATC_SCHEMA_ARGS} ) endif() set(working_dir "${CMAKE_CURRENT_SOURCE_DIR}") set(schema_glob "*.fbs") # Generate the include files parameters. set(include_params "") set(all_generated_files "") foreach (include_dir ${schema_include_dirs}) set(include_params -I ${include_dir} ${include_params}) if (NOT ${copy_text_schemas_dir} STREQUAL "") # Copy text schemas from dependent folders. file(GLOB_RECURSE dependent_schemas ${include_dir}/${schema_glob}) foreach (dependent_schema ${dependent_schemas}) file(COPY ${dependent_schema} DESTINATION ${copy_text_schemas_dir}) endforeach() endif() endforeach() foreach(schema ${flatbuffers_schemas}) get_filename_component(filename ${schema} NAME_WE) # For each schema, do the things we requested. if (NOT ${generated_includes_dir} STREQUAL "") set(generated_include ${generated_includes_dir}/${filename}_generated.h) add_custom_command( OUTPUT ${generated_include} COMMAND ${FLATC} ${FLATC_SCHEMA_ARGS} -o ${generated_includes_dir} ${include_params} -c ${schema} DEPENDS ${FLATC_TARGET} ${schema} ${additional_dependencies} WORKING_DIRECTORY "${working_dir}") list(APPEND all_generated_files ${generated_include}) endif() if (NOT ${binary_schemas_dir} STREQUAL "") set(binary_schema ${binary_schemas_dir}/${filename}.bfbs) add_custom_command( OUTPUT ${binary_schema} COMMAND ${FLATC} -b --schema -o ${binary_schemas_dir} ${include_params} ${schema} DEPENDS ${FLATC_TARGET} ${schema} ${additional_dependencies} WORKING_DIRECTORY "${working_dir}") list(APPEND all_generated_files ${binary_schema}) endif() if (NOT ${copy_text_schemas_dir} STREQUAL "") file(COPY ${schema} DESTINATION ${copy_text_schemas_dir}) endif() endforeach() # Create a custom target that depends on all the generated files. # This is the target that you can depend on to trigger all these # to be built. add_custom_target(${custom_target_name} DEPENDS ${all_generated_files} ${additional_dependencies}) # Register the include directory we are using. if (NOT ${generated_includes_dir} STREQUAL "") include_directories(${generated_includes_dir}) set_property(TARGET ${custom_target_name} PROPERTY GENERATED_INCLUDES_DIR ${generated_includes_dir}) endif() # Register the binary schemas dir we are using. if (NOT ${binary_schemas_dir} STREQUAL "") set_property(TARGET ${custom_target_name} PROPERTY BINARY_SCHEMAS_DIR ${binary_schemas_dir}) endif() # Register the text schema copy dir we are using. if (NOT ${copy_text_schemas_dir} STREQUAL "") set_property(TARGET ${custom_target_name} PROPERTY COPY_TEXT_SCHEMAS_DIR ${copy_text_schemas_dir}) endif() endfunction() libsigmf-1.0.2/cmake/FindFlatBuffers.cmake000066400000000000000000000041671434644465300204210ustar00rootroot00000000000000# Copyright 2014 Stefan.Eilemann@epfl.ch # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Find the flatbuffers schema compiler # # Output Variables: # * FLATBUFFERS_FLATC_EXECUTABLE the flatc compiler executable # * FLATBUFFERS_FOUND # # Provides: # * FLATBUFFERS_GENERATE_C_HEADERS(Name ) creates the C++ headers # for the given flatbuffer schema files. # Returns the header files in ${Name}_OUTPUTS set(FLATBUFFERS_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR}) find_program(FLATBUFFERS_FLATC_EXECUTABLE NAMES flatc) find_path(FLATBUFFERS_INCLUDE_DIR NAMES flatbuffers/flatbuffers.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(flatbuffers DEFAULT_MSG FLATBUFFERS_FLATC_EXECUTABLE FLATBUFFERS_INCLUDE_DIR) if(FLATBUFFERS_FOUND) function(FLATBUFFERS_GENERATE_C_HEADERS Name) set(FLATC_OUTPUTS) foreach(FILE ${ARGN}) get_filename_component(FLATC_OUTPUT ${FILE} NAME_WE) set(FLATC_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FLATC_OUTPUT}_generated.h") list(APPEND FLATC_OUTPUTS ${FLATC_OUTPUT}) add_custom_command(OUTPUT ${FLATC_OUTPUT} COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE} ARGS -c -o "${CMAKE_CURRENT_BINARY_DIR}/" ${FILE} DEPENDS ${FILE} COMMENT "Building C++ header for ${FILE}" WORKING_DIRECTORY ..) endforeach() set(${Name}_OUTPUTS ${FLATC_OUTPUTS} PARENT_SCOPE) endfunction() set(FLATBUFFERS_INCLUDE_DIRS ${FLATBUFFERS_INCLUDE_DIR}) include_directories(${CMAKE_BINARY_DIR}) else() set(FLATBUFFERS_INCLUDE_DIR) endif() include("${FLATBUFFERS_CMAKE_DIR}/BuildFlatBuffers.cmake") libsigmf-1.0.2/cmake/SigmfConfig.cmake.in000066400000000000000000000016011434644465300202030ustar00rootroot00000000000000######################################################################## # # Copyright 2019 DeepSig Inc. # # SPDX-License-Identifier: Apache 2.0 # ######################################################################## set(SIGMF_FOUND TRUE) set(SIGMF_ROOT @CMAKE_INSTALL_PREFIX@) find_path( SIGMF_ROOT NAMES include/sigmf/sigmf.h PATHS /usr/local/include /usr/include /usr/local/opt/sigmf/ $ENV{SIGMF_ROOT} ${SIGMF_ROOT} ) set(SIGMF_INCLUDE_DIR ${SIGMF_ROOT}/include) set(SIGMF_INCLUDE_GEN_DIR ${SIGMF_ROOT}/include/sigmf/) set(SIGMF_FLATBUFFERS_INCLUDE_DIR ${SIGMF_ROOT}/include/sigmf/external/) set(SIGMF_JSON_INCLUDE_DIR ${SIGMF_ROOT}/include/sigmf/external/) set(SIGMF_INCLUDE_DIRS ${SIGMF_INCLUDE_DIR} ${SIGMF_FLATBUFFERS_INCLUDE_DIR} ${SIGMF_JSON_INCLUDE_DIR} ${SIGMF_INCLUDE_GEN_DIR}) message(STATUS "Found Sigmf root: " ${SIGMF_ROOT}) libsigmf-1.0.2/cmake/config.cmake.in000066400000000000000000000012051434644465300172550ustar00rootroot00000000000000######################################################################## # # Copyright 2019 DeepSig Inc. # # SPDX-License-Identifier: Apache 2.0 # ######################################################################## include(FindPackageHandleStandardArgs) set(${CMAKE_FIND_PACKAGE_NAME}_CONFIG ${CMAKE_CURRENT_LIST_FILE}) find_package_handle_standard_args(@PROJECT_NAME@ CONFIG_MODE) if(NOT TARGET @PROJECT_NAME@::@LIBSIGMF_TARGET_NAME@) include(CMakeFindDependencyMacro) find_dependency(nlohmann_json REQUIRED) find_dependency(Flatbuffers REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/@LIBSIGMF_TARGETS_EXPORT_NAME@.cmake") endif() libsigmf-1.0.2/docs/000077500000000000000000000000001434644465300142535ustar00rootroot00000000000000libsigmf-1.0.2/docs/index.md000066400000000000000000000007401434644465300157050ustar00rootroot00000000000000 # libsigmf libsigmf is a C++ library for working with [SigMF](https://github.com/gnuradio/sigmf) records. The primary design goals are to be flexible with mixing SigMF namesapces using static types so that errors in namespace usage can be caught at compile time, memory usage is low while working with objects, and accessing fields has low overhead. To accomplish this we have taken advantage of the C preprocessor and C++ templates. The result allows creating objects like so libsigmf-1.0.2/docs/license.md000066400000000000000000000244001434644465300162170ustar00rootroot00000000000000Apache License ============== _Version 2.0, January 2004_ _<>_ ### Terms and Conditions for use, reproduction, and distribution #### 1. Definitions “License” shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. “Licensor” shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. “Legal Entity” shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, “control” means **(i)** the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the outstanding shares, or **(iii)** beneficial ownership of such entity. “You” (or “Your”) shall mean an individual or Legal Entity exercising permissions granted by this License. “Source” form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. “Object” form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. “Work” shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). “Derivative Works” shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. “Contribution” shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, “submitted” means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as “Not a Contribution.” “Contributor” shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. #### 2. Grant of Copyright License Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. #### 3. Grant of Patent License Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. #### 4. Redistribution You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: * **(a)** You must give any other recipients of the Work or Derivative Works a copy of this License; and * **(b)** You must cause any modified files to carry prominent notices stating that You changed the files; and * **(c)** You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and * **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. #### 5. Submission of Contributions Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. #### 6. Trademarks This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. #### 7. Disclaimer of Warranty Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. #### 8. Limitation of Liability In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. #### 9. Accepting Warranty or Additional Liability While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. _END OF TERMS AND CONDITIONS_ ### APPENDIX: How to apply the Apache License to your work To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets `[]` replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same “printed page” as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. libsigmf-1.0.2/examples/000077500000000000000000000000001434644465300151415ustar00rootroot00000000000000libsigmf-1.0.2/examples/CMakeLists.txt000066400000000000000000000033301434644465300177000ustar00rootroot00000000000000 # This is the bare minimum to use libsigmf along with some example usage patterns add_executable(example_record_with_variadic_dataclass example_record_with_variadic_dataclass.cpp) target_link_libraries(example_record_with_variadic_dataclass libsigmf) target_include_directories(example_record_with_variadic_dataclass PRIVATE ${CMAKE_BINARY_DIR}/include) add_executable(example_record_with_multiple_namespaces example_record_with_multiple_namespaces.cpp) target_link_libraries(example_record_with_multiple_namespaces libsigmf) target_include_directories(example_record_with_multiple_namespaces PRIVATE ${CMAKE_BINARY_DIR}/include) add_executable(example_sigmf_json_roundtrip example_sigmf_json_roundtrip.cpp) target_link_libraries(example_sigmf_json_roundtrip libsigmf) target_include_directories(example_sigmf_json_roundtrip PRIVATE ${CMAKE_BINARY_DIR}/include) add_executable(example_reading_sigmf_file example_reading_sigmf_file.cpp) target_link_libraries(example_reading_sigmf_file libsigmf) target_include_directories(example_reading_sigmf_file PRIVATE ${CMAKE_BINARY_DIR}/include) add_test(NAME simple_variadic_sigmf_to_json COMMAND example_record_with_variadic_dataclass) add_test(NAME simple_variadic_2ns_sigmf_to_json COMMAND example_record_with_multiple_namespaces) # This demonstrates some of the features of flatbuffers we use internally to libsigmf. This is primaryily useful to # experiment / understand the libsigmf internals on concrete flatbuffers types outside of the heavily templated # VariadicDataClass add_executable(flatbuffer_patterns flatbuffer_patterns.cpp) target_link_libraries(flatbuffer_patterns libsigmf) target_include_directories(flatbuffer_patterns PRIVATE ${CMAKE_BINARY_DIR}/include) libsigmf-1.0.2/examples/example.sigmf-meta000066400000000000000000000031771434644465300205570ustar00rootroot00000000000000{ "annotations": [ { "core:description": "signal1", "core:freq_lower_edge": 443062254.4144396, "core:freq_upper_edge": 443106250.0, "core:sample_count": 571392, "core:sample_start": 2497536 }, { "signal:detail": { "type": "digital", "duplexing": "ofdm" }, "signal:emitter": { "seid": 123, "manufacturer": "DeepSig Inc.", "power_tx": 30.0, "power_eirp": 36.1, "geolocation": { "type": "point", "coordinates": [ 0, 0 ] } }, "core:description": "signal1", "core:freq_lower_edge": 444156250.0, "core:freq_upper_edge": 444198750.0, "core:sample_count": 718848, "core:sample_start": 961536 } ], "captures": [ { "core:frequency": 440000000.0, "core:global_index": 0, "core:sample_start": 0 } ], "global": { "antenna:horizontal_gain_pattern": [ 0.1, 0.2, 0.3 ], "antenna:mobile": false, "core:author": "DeepSig Inc.", "core:datatype": "ci16_le", "core:description": "example sigmf-meta file with a wide range of fields and extensions", "core:extensions": [ { "name": "antenna", "optional": false, "version": "1.0.0" }, { "name": "capture_details", "optional": false, "version": "1.0.0" }, { "name": "signal", "optional": false, "version": "1.0.0" } ], "core:geolocation": { "coordinates": [ 12.34, 43.21, 0.99 ], "type": "point" }, "core:license": "Apache License, Version 2.0", "core:metadata_only": true, "core:sample_rate": 30720000.0, "core:version": "0.0.1" } } libsigmf-1.0.2/examples/example2.sigmf-meta000066400000000000000000000013421434644465300206310ustar00rootroot00000000000000{ "annotations": [ { "core:description": "signal1", "core:freq_lower_edge": 4.4306225441443962E+8, "core:freq_upper_edge": 4.4310625E+8, "core:sample_start": 2.497536E+6, "core:sample_count": 571392 }, { "core:sample_start": 961536, "core:sample_count": 718848 } ], "captures": [ { "core:global_index": 0, "core:sample_start": 0 } ], "global":{ "core:datatype": "ci16_le", "core:description": "minimal sigmf-meta example using only `core` fields", "core:license": "Apache License, Version 2.0", "core:metadata_only": true } } libsigmf-1.0.2/examples/example_reading_sigmf_file.cpp000066400000000000000000000027171434644465300231640ustar00rootroot00000000000000/* * Copyright 2019, 2021, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "sigmf_core_generated.h" #include "sigmf_antenna_generated.h" #include "sigmf_capture_details_generated.h" #include "sigmf_signal_generated.h" #include "sigmf.h" #include "sigmf_helpers.h" #include #include int main(int argc, char* argv[]) { std::cout << "Reading file " << argv[1] << std::endl;; auto meta_fstream = std::ifstream(argv[1]); // returns a sigmf object auto record = sigmf::metadata_file_to_json(meta_fstream); std::cout << "The data size is " << sigmf::get_sample_size(record->global.access().datatype) << " bytes\n"; std::cout << "The record we read is: \n" << record->to_json().dump(2) << std::endl; std::cout << "example_reading_sigmf_file passed (just a smoke test, no field validation)" << std::endl; return 0; // assert passed, we're good :+1: } libsigmf-1.0.2/examples/example_record_with_multiple_namespaces.cpp000066400000000000000000000153101434644465300260030ustar00rootroot00000000000000/* * Copyright 2019, 2021, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "sigmf_core_generated.h" #include "sigmf_antenna_generated.h" #include "sigmf_capture_details_generated.h" #include "sigmf_signal_generated.h" #include "sigmf.h" #include "testing_protocols_generated.h" using namespace sigmf; int main() { /* * Create a record with 2 namespace available in it. Note that antenna namespace doesnt have capture segments. * Also use this to show off using the sigmf::Global, sigmf::Capture, and sigmf::Annotation classes. These * classes are light wrappers around the sigmf::VariadicDataClass but make it easier to express intent of * what kind of stuff (in sigmf-lingo) the underlying class is supposed to hold. */ sigmf::SigMF, sigmf::Capture, sigmf::Annotation > latest_record; latest_record.global.access().author = "Nathan"; latest_record.global.access().description = "Example of creating a new record"; latest_record.global.access().sample_rate = 1.0; latest_record.global.access().mobile = true; latest_record.global.access().gain = 40.0; latest_record.global.access().low_frequency = 600e6; latest_record.global.access().high_frequency = 1200e6; latest_record.global.access().vertical_gain_pattern = {-40,-40,-40,0,10,0,-40,-40,-40}; // Add a capture segment auto antenna_capture = sigmf::Capture(); antenna_capture.get().frequency = 870e6; antenna_capture.get().global_index = 0; latest_record.captures.emplace_back(antenna_capture); auto &fancy_capture = latest_record.captures.create_new(); auto &fancy_cap_core = fancy_capture.get(); fancy_cap_core.datetime = "the future"; fancy_cap_core.sample_start = 9001; // Add some annotations (sigmf::core_annotations is typedef of core::AnnotationT, so they're interchangeable) // This example uses the core::AnnotationT to access data elements which is more using the VariadicDataClass interface auto anno2 = sigmf::Annotation(); anno2.access().sample_count = 500000; anno2.access().description = "Annotation 1"; anno2.access().generator = "libsigmf"; anno2.access().description = "Woah!"; latest_record.annotations.emplace_back(anno2); // This example shows off using the Annotation-specific interface where we know it's an annotation, so we // get annotation field from the underlying DescrT... This uses a little bit of syntactic sugar on top of // the VariadicDataClass and basically you don't have to repeat "annotation" in your get/access method. auto anno3 = sigmf::Annotation(); anno3.get().sample_count = 600000; anno3.get().description = "Annotation 2"; anno3.get().generator = "libsigmf"; anno3.get().description = "Pretty easy"; anno3.get().elevation_angle = 4.2; // here are some examples of how to initialize subtable fields: signal::signal_detailT detail_obj; detail_obj.type = std::string("analog"); detail_obj.duplexing = std::string("fdm"); anno3.get().detail = std::make_shared(detail_obj); core::geojson_pointT anno3_geo; anno3_geo.type = "point"; anno3_geo.coordinates = std::vector( { 98, 123.4, 1e-9} ); signal::signal_emitterT emitter_obj; emitter_obj.manufacturer = std::string("deepsig"); emitter_obj.power_tx = 27.1; emitter_obj.geolocation = std::make_shared(anno3_geo); anno3.get().emitter = std::make_shared(emitter_obj); // You can also drop in this syntactic acid using this interface which I personally don't really like because // it mixes real calls with macros without it being obvious and doesn't really feel like c++ anno3.sigmfns(antenna).azimuth_angle = 0.1; anno3.get().polarization = "circular"; anno3.get().SNRdB = 12.34; latest_record.annotations.emplace_back(anno3); auto expected_json = R"({ "annotations": [ { "core:description": "Woah!", "core:generator": "libsigmf", "core:sample_count": 500000 }, { "antenna:azimuth_angle": 0.1, "antenna:elevation_angle": 4.2, "antenna:polarization": "circular", "capture_details:SNRdB": 12.34, "core:description": "Pretty easy", "core:generator": "libsigmf", "core:sample_count": 600000, "signal:detail": { "duplexing": "fdm", "type": "analog" }, "signal:emitter": { "geolocation": { "coordinates": [ 98.0, 123.4, 1e-09 ], "type": "point" }, "manufacturer": "deepsig", "power_tx": 27.1 } } ], "captures": [ { "core:frequency": 870000000.0, "core:global_index": 0 }, { "core:datetime": "the future", "core:sample_start": 9001 } ], "global": { "antenna:gain": 40.0, "antenna:high_frequency": 1200000000.0, "antenna:low_frequency": 600000000.0, "antenna:mobile": true, "antenna:vertical_gain_pattern": [ -40.0, -40.0, -40.0, 0.0, 10.0, 0.0, -40.0, -40.0, -40.0 ], "core:author": "Nathan", "core:description": "Example of creating a new record", "core:sample_rate": 1.0 } })"; // std::cout << "JSON Record:\n" << json(latest_record).dump(2) << std::endl; assert(expected_json == json(latest_record).dump(2)); std::cout << "example_record_with_multiple_namespaces passed" << std::endl; return 0; // assert passed, we're good :+1: } libsigmf-1.0.2/examples/example_record_with_variadic_dataclass.cpp000066400000000000000000000107661434644465300255640ustar00rootroot00000000000000/* * Copyright 2019, 2021, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "sigmf_core_generated.h" #include "sigmf.h" #include using namespace sigmf; int main() { /* * Create a record with core namespace using the VariadicDataClass as an example. This is kind of * like a "pure" usage of the variadic data class lightly wrapped together with our SigMF object. * The suggested usage for SigMF purposes is that you do not directly use sigmf::VariadticDataClass<...> * but instead use the more descriptive sigmf::Annotation, sigmf::Capture, sigmf::Global classes. */ sigmf::SigMF, sigmf::VariadicDataClass, sigmf::VariadicDataClass > example_record; example_record.global.access().author = "Nathan"; example_record.global.access().description = "Example of creating a new record"; example_record.global.access().sample_rate = 1.0; // Add a capture segment auto new_capture = sigmf::VariadicDataClass(); new_capture.access().frequency = 870e6; new_capture.access().global_index = 5000; new_capture.access().sample_start = 10; new_capture.access().datetime = "now"; example_record.captures.emplace_back(new_capture); // Add some annotations auto anno0 = sigmf::VariadicDataClass(); anno0.access().description = "Annotation 1"; anno0.access().generator = "libsigmf"; anno0.access().description = "Woah!"; auto &ref = anno0.access(); // You can get it once at keep a reference if you want ref.comment = "References make it a bit easier to access and modify the data parts"; ref.sample_count = 500000; example_record.annotations.emplace_back(anno0); auto anno1 = sigmf::VariadicDataClass(); anno1.access().sample_count = 600000; anno1.access().description = "Annotation 2"; anno1.access().generator = "libsigmf"; anno1.access().description = "Pretty easy"; example_record.annotations.emplace_back(anno1); // You can also use reference_wrappers to make it slightly less verbose... auto anno2 = sigmf::VariadicDataClass(); auto core_anno_ref = std::ref(anno1.access()); core_anno_ref.get().sample_count = 100000; core_anno_ref.get().description = "ref-wrapped"; auto anno3 = sigmf::VariadicDataClass(); core_anno_ref = std::ref(anno3.access()); // Notice we didn't push anno2 or anno3 on to the annotations vector, so they aren't part of the record // Make it a json (from modernjson) object and verify its output std::stringstream json_output; json_output << json(example_record).dump(2) << std::flush; std::string expected_output = R"({ "annotations": [ { "core:comment": "References make it a bit easier to access and modify the data parts", "core:description": "Woah!", "core:generator": "libsigmf", "core:sample_count": 500000 }, { "core:description": "Pretty easy", "core:generator": "libsigmf", "core:sample_count": 600000 } ], "captures": [ { "core:datetime": "now", "core:frequency": 870000000.0, "core:global_index": 5000, "core:sample_start": 10 } ], "global": { "core:author": "Nathan", "core:description": "Example of creating a new record", "core:sample_rate": 1.0 } })"; // std::cout << "JSON Record:\n" << json_output.str() << std::endl; assert(expected_output == json_output.str()); std::cout << "expected_record_with_variadic_dataclass passed" << std::endl; return 0; // assert passed, we're good :+1: } libsigmf-1.0.2/examples/example_sigmf_json_roundtrip.cpp000066400000000000000000000065441434644465300236350ustar00rootroot00000000000000/* * Copyright 2019, 2021, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "sigmf.h" #include using namespace sigmf; int main() { /* * this test will fail right now because the annotation core:sample_count field * is still not truly optional (default = 0). adding `=null` to this field will * make this test pass demonstrating the std::optional scalar field operation. */ std::string starting_str(R"({ "annotations": [ { "core:description": "no fish", "core:sample_count": 0, "core:sample_start": 0 }, { "core:description": "one fish", "core:sample_count": 1, "core:sample_start": 1 }, { "core:description": "two fish", "core:sample_count": 2, "core:sample_start": 2 }, { "core:description": "red fish", "core:freq_lower_edge": 0.0, "core:freq_upper_edge": 100000000.0, "core:sample_count": 3, "core:sample_start": 3 }, { "core:description": "blue fish", "core:sample_count": 4, "core:sample_start": 4 } ], "captures": [ { "core:frequency": 99999.1, "core:sample_start": 0 }, { "core:frequency": 99999.2, "core:sample_start": 42 } ], "global": { "antenna:mobile": false, "antenna:vertical_gain_pattern": [ 0.0, 1.0, 6.0, 10.0, 6.0, 1.0, 0.0 ], "core:author": "DeepSig", "core:description": "Round-trip from json -> libsigmf -> back", "core:extensions": [ { "name": "fake_extension_1", "optional": false, "version": "0.1.2.3.4.5.6" }, { "name": "another fake ext", "optional": true, "version": "2" } ], "core:geolocation": { "coordinates": [ 12.34, 5.678, 9.0 ], "type": "point" }, "core:sample_rate": 1000000.0 } })"); auto as_json = json::parse(starting_str); sigmf::SigMF, sigmf::Capture, sigmf::Annotation > roundtripstuff = as_json; auto back_to_json = json(roundtripstuff); std::cout << back_to_json.dump(4) << std::endl; assert(back_to_json.dump(4) == starting_str); std::cout << "example_sigmf_json_roundtrip passed" << std::endl; return 0; // assert passed, we're good :+1: } libsigmf-1.0.2/examples/flatbuffer_patterns.cpp000066400000000000000000000131211434644465300217030ustar00rootroot00000000000000/* * Copyright 2019, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "flatbuffers/minireflect.h" // For flatbuffers::FlatBufferToString #include "sigmf_core_generated.h" #include "testing_protocols_generated.h" #include #include using namespace sigmf; int main() { // // The standard way of dealing with flatbuffers... // // You have to create a FlatBufferBuilder which manages the memory and has generic mutators for all of flatbuffer's internal types flatbuffers::FlatBufferBuilder fbb; // This is a Builder for our type-- you need to give it a FlatBufferBuilder // This basically knows how to translate our named fields in to flatbuffer's internal types/field indexes core::AnnotationBuilder abb(fbb); // Now we can set some field abb.add_freq_lower_edge(30.0); // When you're done adding data you finish your buffer flatbuffers::Offset offset_in_buffer = abb.Finish(); // Now you have to finish the original buffer by telling it the offset (basically how big our type is) fbb.Finish(offset_in_buffer); // Now you can get an object back from the original FlatBufferBuilder using a templated GetRoot... const core::Annotation *anno = flatbuffers::GetRoot(fbb.GetBufferPointer()); // And inspect the values you put it std::cout << anno->freq_lower_edge().value_or(-1) << std::endl; // // Adding more complex types (strings, composite types,... ) // flatbuffers::FlatBufferBuilder composite_fbb; uint32_t vvv[] = {1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1}; std::cout << "vec has size " << sizeof(vvv) / sizeof(uint32_t) << std::endl; auto vecoffset = composite_fbb.CreateVector(vvv, sizeof(vvv) / sizeof(uint32_t)); auto stroffset = composite_fbb.CreateString("testing one two"); std::vector > nativevecstr = {composite_fbb.CreateString("one"), composite_fbb.CreateString("two"), composite_fbb.CreateString("thre")}; auto vecofstrings = composite_fbb.CreateVector(nativevecstr); // need Offset > > > testing_vecsBuilder vecbuilder(composite_fbb); vecbuilder.add_myvecfortesting(vecoffset); vecbuilder.add_name(stroffset); auto testvecadded = vecbuilder.Finish(); composite_fbb.Finish(testvecadded); const testing_vecs *vecs = flatbuffers::GetRoot(composite_fbb.GetBufferPointer()); std::cout << "O: " << flatbuffers::FlatBufferToString(composite_fbb.GetBufferPointer(), testing_vecsTypeTable()) << std::endl; // // Now there is also the object API which we use exclusively in libsigmf.... // core::AnnotationT annotation_object; annotation_object.generator = "this is much easier"; annotation_object.sample_count = 1; // To get a transportable (encoded) flatbuffer you need to pack it with a flatbuffer... flatbuffers::FlatBufferBuilder fbb2; // (A core::Annotation is a core::AnnotationT::TableType, but it's exposed through the object API) // From the object, you need to pack it in to a FlatBufferBuilder and Finish that auto offset = core::AnnotationT::TableType::Pack(fbb2, &annotation_object); // this is a static method fbb2.Finish(offset); std::cout << "presumably we would transmit starting at fbb2.GetBufferPointer() for " << fbb2.GetSize() << " B" << std::endl; std::cout << "O: " << flatbuffers::FlatBufferToString(fbb2.GetBufferPointer(), core::AnnotationT::TableType::MiniReflectTypeTable()) << std::endl; // If you want to access that buffer as a core::Annotation... const core::AnnotationT::TableType *packed_anno = flatbuffers::GetRoot( fbb2.GetBufferPointer()); std::cout << packed_anno->generator()->c_str() << std::endl; // // For the more generic building case we can just use the enums to fill the fbb // flatbuffers::FlatBufferBuilder generic_fbb; auto strloc = generic_fbb.CreateString("glarble"); auto startoftable = generic_fbb.StartTable(); generic_fbb.AddElement(core::AnnotationT::TableType::VT_FREQ_LOWER_EDGE, double(4.0), double(0.0)); generic_fbb.AddElement(core::AnnotationT::TableType::VT_FREQ_UPPER_EDGE, double(5.0), double(0.0)); generic_fbb.AddOffset(core::AnnotationT::TableType::VT_GENERATOR, strloc); auto endoftable = generic_fbb.EndTable(startoftable); generic_fbb.Finish(flatbuffers::Offset(endoftable)); const core::AnnotationT::TableType *generic_anno = flatbuffers::GetRoot( generic_fbb.GetBufferPointer()); std::cout << generic_anno->freq_lower_edge().value_or(-1) << std::endl; std::cout << generic_anno->freq_upper_edge().value_or(-1) << std::endl; std::cout << generic_anno->generator()->c_str() << std::endl; } libsigmf-1.0.2/external/000077500000000000000000000000001434644465300151455ustar00rootroot00000000000000libsigmf-1.0.2/external/flatbuffers/000077500000000000000000000000001434644465300174505ustar00rootroot00000000000000libsigmf-1.0.2/external/json/000077500000000000000000000000001434644465300161165ustar00rootroot00000000000000libsigmf-1.0.2/mkdocs.yml000066400000000000000000000003441434644465300153270ustar00rootroot00000000000000 site_name: libsigmf site_url: https://pages.gitlab.io/deepsig/opensource/libsigmf repo_url: https://github.com/deepsig/opensource/libsigmf/ theme: name: readthedocs nav: - Home: 'index.md' - License: 'license.md' libsigmf-1.0.2/performance.json000066400000000000000000000017641434644465300165270ustar00rootroot00000000000000[ { "subject": "/gitlab-org/gitlab-ce/issues/1", "metrics": [ { "name": "Transfer Size (KB)", "value": "1529.2", "desiredSize": "smaller" }, { "name": "Speed Index", "value": 1162, "desiredSize": "smaller" }, { "name": "Total Score", "value": 57, "desiredSize": "larger" }, { "name": "Requests", "value": 41, "desiredSize": "smaller" } ] }, { "subject": "/gitlab-org/gitlab-ee/merge_requests/3507", "metrics": [ { "name": "Transfer Size (KB)", "value": "2399.8", "desiredSize": "smaller" }, { "name": "Speed Index", "value": 3122, "desiredSize": "smaller" }, { "name": "Total Score", "value": 53, "desiredSize": "larger" }, { "name": "Requests", "value": 41, "desiredSize": "smaller" } ] } ] libsigmf-1.0.2/sigmf_protocols/000077500000000000000000000000001434644465300165345ustar00rootroot00000000000000libsigmf-1.0.2/sigmf_protocols/sigmf_adsb.fbs000066400000000000000000000012321434644465300213240ustar00rootroot00000000000000 namespace sigmf.adsb; table Global { /*`adsb` does not extend `global`*/ } table Capture { /*`adsb` does not extend `captures`*/ } table Annotation { standard:string; frame_type_phy:string; channel:long=null; start_time_s:double=null; stop_time_s:double=null; frame_duration_s:double=null; MCS:double=null; MAC_frame_type:string; MAC_ta:string; MAC_ra:string; manufacturer_ta:string; MAC_frame:string; CRC:string; start_of_packet:double=null; stop_of_packet:double=null; number_of_samples_in_packet:double=null; } table Descr { global:Global; annotation:Annotation; capture:Capture; } libsigmf-1.0.2/sigmf_protocols/sigmf_adsb_generated.h000066400000000000000000000667101434644465300230330ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_SIGMFADSB_SIGMF_ADSB_H_ #define FLATBUFFERS_GENERATED_SIGMFADSB_SIGMF_ADSB_H_ #include "flatbuffers/flatbuffers.h" namespace sigmf { namespace adsb { struct Global; struct GlobalBuilder; struct GlobalT; struct Capture; struct CaptureBuilder; struct CaptureT; struct Annotation; struct AnnotationBuilder; struct AnnotationT; struct Descr; struct DescrBuilder; struct DescrT; inline const flatbuffers::TypeTable *GlobalTypeTable(); inline const flatbuffers::TypeTable *CaptureTypeTable(); inline const flatbuffers::TypeTable *AnnotationTypeTable(); inline const flatbuffers::TypeTable *DescrTypeTable(); struct GlobalT : public flatbuffers::NativeTable { typedef Global TableType; }; struct Global FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef GlobalT NativeTableType; typedef GlobalBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return GlobalTypeTable(); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } GlobalT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct GlobalBuilder { typedef Global Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; explicit GlobalBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateGlobal( flatbuffers::FlatBufferBuilder &_fbb) { GlobalBuilder builder_(_fbb); return builder_.Finish(); } flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct CaptureT : public flatbuffers::NativeTable { typedef Capture TableType; }; struct Capture FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CaptureT NativeTableType; typedef CaptureBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return CaptureTypeTable(); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } CaptureT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct CaptureBuilder { typedef Capture Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; explicit CaptureBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateCapture( flatbuffers::FlatBufferBuilder &_fbb) { CaptureBuilder builder_(_fbb); return builder_.Finish(); } flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct AnnotationT : public flatbuffers::NativeTable { typedef Annotation TableType; std::string standard{}; std::string frame_type_phy{}; flatbuffers::Optional channel = flatbuffers::nullopt; flatbuffers::Optional start_time_s = flatbuffers::nullopt; flatbuffers::Optional stop_time_s = flatbuffers::nullopt; flatbuffers::Optional frame_duration_s = flatbuffers::nullopt; flatbuffers::Optional MCS = flatbuffers::nullopt; std::string MAC_frame_type{}; std::string MAC_ta{}; std::string MAC_ra{}; std::string manufacturer_ta{}; std::string MAC_frame{}; std::string CRC{}; flatbuffers::Optional start_of_packet = flatbuffers::nullopt; flatbuffers::Optional stop_of_packet = flatbuffers::nullopt; flatbuffers::Optional number_of_samples_in_packet = flatbuffers::nullopt; }; struct Annotation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef AnnotationT NativeTableType; typedef AnnotationBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return AnnotationTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_STANDARD = 4, VT_FRAME_TYPE_PHY = 6, VT_CHANNEL = 8, VT_START_TIME_S = 10, VT_STOP_TIME_S = 12, VT_FRAME_DURATION_S = 14, VT_MCS = 16, VT_MAC_FRAME_TYPE = 18, VT_MAC_TA = 20, VT_MAC_RA = 22, VT_MANUFACTURER_TA = 24, VT_MAC_FRAME = 26, VT_CRC = 28, VT_START_OF_PACKET = 30, VT_STOP_OF_PACKET = 32, VT_NUMBER_OF_SAMPLES_IN_PACKET = 34 }; const flatbuffers::String *standard() const { return GetPointer(VT_STANDARD); } const flatbuffers::String *frame_type_phy() const { return GetPointer(VT_FRAME_TYPE_PHY); } flatbuffers::Optional channel() const { return GetOptional(VT_CHANNEL); } flatbuffers::Optional start_time_s() const { return GetOptional(VT_START_TIME_S); } flatbuffers::Optional stop_time_s() const { return GetOptional(VT_STOP_TIME_S); } flatbuffers::Optional frame_duration_s() const { return GetOptional(VT_FRAME_DURATION_S); } flatbuffers::Optional MCS() const { return GetOptional(VT_MCS); } const flatbuffers::String *MAC_frame_type() const { return GetPointer(VT_MAC_FRAME_TYPE); } const flatbuffers::String *MAC_ta() const { return GetPointer(VT_MAC_TA); } const flatbuffers::String *MAC_ra() const { return GetPointer(VT_MAC_RA); } const flatbuffers::String *manufacturer_ta() const { return GetPointer(VT_MANUFACTURER_TA); } const flatbuffers::String *MAC_frame() const { return GetPointer(VT_MAC_FRAME); } const flatbuffers::String *CRC() const { return GetPointer(VT_CRC); } flatbuffers::Optional start_of_packet() const { return GetOptional(VT_START_OF_PACKET); } flatbuffers::Optional stop_of_packet() const { return GetOptional(VT_STOP_OF_PACKET); } flatbuffers::Optional number_of_samples_in_packet() const { return GetOptional(VT_NUMBER_OF_SAMPLES_IN_PACKET); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_STANDARD) && verifier.VerifyString(standard()) && VerifyOffset(verifier, VT_FRAME_TYPE_PHY) && verifier.VerifyString(frame_type_phy()) && VerifyField(verifier, VT_CHANNEL) && VerifyField(verifier, VT_START_TIME_S) && VerifyField(verifier, VT_STOP_TIME_S) && VerifyField(verifier, VT_FRAME_DURATION_S) && VerifyField(verifier, VT_MCS) && VerifyOffset(verifier, VT_MAC_FRAME_TYPE) && verifier.VerifyString(MAC_frame_type()) && VerifyOffset(verifier, VT_MAC_TA) && verifier.VerifyString(MAC_ta()) && VerifyOffset(verifier, VT_MAC_RA) && verifier.VerifyString(MAC_ra()) && VerifyOffset(verifier, VT_MANUFACTURER_TA) && verifier.VerifyString(manufacturer_ta()) && VerifyOffset(verifier, VT_MAC_FRAME) && verifier.VerifyString(MAC_frame()) && VerifyOffset(verifier, VT_CRC) && verifier.VerifyString(CRC()) && VerifyField(verifier, VT_START_OF_PACKET) && VerifyField(verifier, VT_STOP_OF_PACKET) && VerifyField(verifier, VT_NUMBER_OF_SAMPLES_IN_PACKET) && verifier.EndTable(); } AnnotationT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct AnnotationBuilder { typedef Annotation Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_standard(flatbuffers::Offset standard) { fbb_.AddOffset(Annotation::VT_STANDARD, standard); } void add_frame_type_phy(flatbuffers::Offset frame_type_phy) { fbb_.AddOffset(Annotation::VT_FRAME_TYPE_PHY, frame_type_phy); } void add_channel(int64_t channel) { fbb_.AddElement(Annotation::VT_CHANNEL, channel); } void add_start_time_s(double start_time_s) { fbb_.AddElement(Annotation::VT_START_TIME_S, start_time_s); } void add_stop_time_s(double stop_time_s) { fbb_.AddElement(Annotation::VT_STOP_TIME_S, stop_time_s); } void add_frame_duration_s(double frame_duration_s) { fbb_.AddElement(Annotation::VT_FRAME_DURATION_S, frame_duration_s); } void add_MCS(double MCS) { fbb_.AddElement(Annotation::VT_MCS, MCS); } void add_MAC_frame_type(flatbuffers::Offset MAC_frame_type) { fbb_.AddOffset(Annotation::VT_MAC_FRAME_TYPE, MAC_frame_type); } void add_MAC_ta(flatbuffers::Offset MAC_ta) { fbb_.AddOffset(Annotation::VT_MAC_TA, MAC_ta); } void add_MAC_ra(flatbuffers::Offset MAC_ra) { fbb_.AddOffset(Annotation::VT_MAC_RA, MAC_ra); } void add_manufacturer_ta(flatbuffers::Offset manufacturer_ta) { fbb_.AddOffset(Annotation::VT_MANUFACTURER_TA, manufacturer_ta); } void add_MAC_frame(flatbuffers::Offset MAC_frame) { fbb_.AddOffset(Annotation::VT_MAC_FRAME, MAC_frame); } void add_CRC(flatbuffers::Offset CRC) { fbb_.AddOffset(Annotation::VT_CRC, CRC); } void add_start_of_packet(double start_of_packet) { fbb_.AddElement(Annotation::VT_START_OF_PACKET, start_of_packet); } void add_stop_of_packet(double stop_of_packet) { fbb_.AddElement(Annotation::VT_STOP_OF_PACKET, stop_of_packet); } void add_number_of_samples_in_packet(double number_of_samples_in_packet) { fbb_.AddElement(Annotation::VT_NUMBER_OF_SAMPLES_IN_PACKET, number_of_samples_in_packet); } explicit AnnotationBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateAnnotation( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset standard = 0, flatbuffers::Offset frame_type_phy = 0, flatbuffers::Optional channel = flatbuffers::nullopt, flatbuffers::Optional start_time_s = flatbuffers::nullopt, flatbuffers::Optional stop_time_s = flatbuffers::nullopt, flatbuffers::Optional frame_duration_s = flatbuffers::nullopt, flatbuffers::Optional MCS = flatbuffers::nullopt, flatbuffers::Offset MAC_frame_type = 0, flatbuffers::Offset MAC_ta = 0, flatbuffers::Offset MAC_ra = 0, flatbuffers::Offset manufacturer_ta = 0, flatbuffers::Offset MAC_frame = 0, flatbuffers::Offset CRC = 0, flatbuffers::Optional start_of_packet = flatbuffers::nullopt, flatbuffers::Optional stop_of_packet = flatbuffers::nullopt, flatbuffers::Optional number_of_samples_in_packet = flatbuffers::nullopt) { AnnotationBuilder builder_(_fbb); if(number_of_samples_in_packet) { builder_.add_number_of_samples_in_packet(*number_of_samples_in_packet); } if(stop_of_packet) { builder_.add_stop_of_packet(*stop_of_packet); } if(start_of_packet) { builder_.add_start_of_packet(*start_of_packet); } if(MCS) { builder_.add_MCS(*MCS); } if(frame_duration_s) { builder_.add_frame_duration_s(*frame_duration_s); } if(stop_time_s) { builder_.add_stop_time_s(*stop_time_s); } if(start_time_s) { builder_.add_start_time_s(*start_time_s); } if(channel) { builder_.add_channel(*channel); } builder_.add_CRC(CRC); builder_.add_MAC_frame(MAC_frame); builder_.add_manufacturer_ta(manufacturer_ta); builder_.add_MAC_ra(MAC_ra); builder_.add_MAC_ta(MAC_ta); builder_.add_MAC_frame_type(MAC_frame_type); builder_.add_frame_type_phy(frame_type_phy); builder_.add_standard(standard); return builder_.Finish(); } inline flatbuffers::Offset CreateAnnotationDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *standard = nullptr, const char *frame_type_phy = nullptr, flatbuffers::Optional channel = flatbuffers::nullopt, flatbuffers::Optional start_time_s = flatbuffers::nullopt, flatbuffers::Optional stop_time_s = flatbuffers::nullopt, flatbuffers::Optional frame_duration_s = flatbuffers::nullopt, flatbuffers::Optional MCS = flatbuffers::nullopt, const char *MAC_frame_type = nullptr, const char *MAC_ta = nullptr, const char *MAC_ra = nullptr, const char *manufacturer_ta = nullptr, const char *MAC_frame = nullptr, const char *CRC = nullptr, flatbuffers::Optional start_of_packet = flatbuffers::nullopt, flatbuffers::Optional stop_of_packet = flatbuffers::nullopt, flatbuffers::Optional number_of_samples_in_packet = flatbuffers::nullopt) { auto standard__ = standard ? _fbb.CreateString(standard) : 0; auto frame_type_phy__ = frame_type_phy ? _fbb.CreateString(frame_type_phy) : 0; auto MAC_frame_type__ = MAC_frame_type ? _fbb.CreateString(MAC_frame_type) : 0; auto MAC_ta__ = MAC_ta ? _fbb.CreateString(MAC_ta) : 0; auto MAC_ra__ = MAC_ra ? _fbb.CreateString(MAC_ra) : 0; auto manufacturer_ta__ = manufacturer_ta ? _fbb.CreateString(manufacturer_ta) : 0; auto MAC_frame__ = MAC_frame ? _fbb.CreateString(MAC_frame) : 0; auto CRC__ = CRC ? _fbb.CreateString(CRC) : 0; return sigmf::adsb::CreateAnnotation( _fbb, standard__, frame_type_phy__, channel, start_time_s, stop_time_s, frame_duration_s, MCS, MAC_frame_type__, MAC_ta__, MAC_ra__, manufacturer_ta__, MAC_frame__, CRC__, start_of_packet, stop_of_packet, number_of_samples_in_packet); } flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct DescrT : public flatbuffers::NativeTable { typedef Descr TableType; std::shared_ptr global{}; std::shared_ptr annotation{}; std::shared_ptr capture{}; }; struct Descr FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DescrT NativeTableType; typedef DescrBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return DescrTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_GLOBAL = 4, VT_ANNOTATION = 6, VT_CAPTURE = 8 }; const sigmf::adsb::Global *global() const { return GetPointer(VT_GLOBAL); } const sigmf::adsb::Annotation *annotation() const { return GetPointer(VT_ANNOTATION); } const sigmf::adsb::Capture *capture() const { return GetPointer(VT_CAPTURE); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_GLOBAL) && verifier.VerifyTable(global()) && VerifyOffset(verifier, VT_ANNOTATION) && verifier.VerifyTable(annotation()) && VerifyOffset(verifier, VT_CAPTURE) && verifier.VerifyTable(capture()) && verifier.EndTable(); } DescrT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DescrBuilder { typedef Descr Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_global(flatbuffers::Offset global) { fbb_.AddOffset(Descr::VT_GLOBAL, global); } void add_annotation(flatbuffers::Offset annotation) { fbb_.AddOffset(Descr::VT_ANNOTATION, annotation); } void add_capture(flatbuffers::Offset capture) { fbb_.AddOffset(Descr::VT_CAPTURE, capture); } explicit DescrBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateDescr( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset global = 0, flatbuffers::Offset annotation = 0, flatbuffers::Offset capture = 0) { DescrBuilder builder_(_fbb); builder_.add_capture(capture); builder_.add_annotation(annotation); builder_.add_global(global); return builder_.Finish(); } flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); inline GlobalT *Global::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new GlobalT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Global::UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; } inline flatbuffers::Offset Global::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateGlobal(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GlobalT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; return sigmf::adsb::CreateGlobal( _fbb); } inline CaptureT *Capture::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new CaptureT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Capture::UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; } inline flatbuffers::Offset Capture::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateCapture(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CaptureT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; return sigmf::adsb::CreateCapture( _fbb); } inline AnnotationT *Annotation::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new AnnotationT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Annotation::UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = standard(); if (_e) _o->standard = _e->str(); } { auto _e = frame_type_phy(); if (_e) _o->frame_type_phy = _e->str(); } { auto _e = channel(); _o->channel = _e; } { auto _e = start_time_s(); _o->start_time_s = _e; } { auto _e = stop_time_s(); _o->stop_time_s = _e; } { auto _e = frame_duration_s(); _o->frame_duration_s = _e; } { auto _e = MCS(); _o->MCS = _e; } { auto _e = MAC_frame_type(); if (_e) _o->MAC_frame_type = _e->str(); } { auto _e = MAC_ta(); if (_e) _o->MAC_ta = _e->str(); } { auto _e = MAC_ra(); if (_e) _o->MAC_ra = _e->str(); } { auto _e = manufacturer_ta(); if (_e) _o->manufacturer_ta = _e->str(); } { auto _e = MAC_frame(); if (_e) _o->MAC_frame = _e->str(); } { auto _e = CRC(); if (_e) _o->CRC = _e->str(); } { auto _e = start_of_packet(); _o->start_of_packet = _e; } { auto _e = stop_of_packet(); _o->stop_of_packet = _e; } { auto _e = number_of_samples_in_packet(); _o->number_of_samples_in_packet = _e; } } inline flatbuffers::Offset Annotation::Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateAnnotation(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const AnnotationT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _standard = _o->standard.empty() ? 0 : _fbb.CreateString(_o->standard); auto _frame_type_phy = _o->frame_type_phy.empty() ? 0 : _fbb.CreateString(_o->frame_type_phy); auto _channel = _o->channel; auto _start_time_s = _o->start_time_s; auto _stop_time_s = _o->stop_time_s; auto _frame_duration_s = _o->frame_duration_s; auto _MCS = _o->MCS; auto _MAC_frame_type = _o->MAC_frame_type.empty() ? 0 : _fbb.CreateString(_o->MAC_frame_type); auto _MAC_ta = _o->MAC_ta.empty() ? 0 : _fbb.CreateString(_o->MAC_ta); auto _MAC_ra = _o->MAC_ra.empty() ? 0 : _fbb.CreateString(_o->MAC_ra); auto _manufacturer_ta = _o->manufacturer_ta.empty() ? 0 : _fbb.CreateString(_o->manufacturer_ta); auto _MAC_frame = _o->MAC_frame.empty() ? 0 : _fbb.CreateString(_o->MAC_frame); auto _CRC = _o->CRC.empty() ? 0 : _fbb.CreateString(_o->CRC); auto _start_of_packet = _o->start_of_packet; auto _stop_of_packet = _o->stop_of_packet; auto _number_of_samples_in_packet = _o->number_of_samples_in_packet; return sigmf::adsb::CreateAnnotation( _fbb, _standard, _frame_type_phy, _channel, _start_time_s, _stop_time_s, _frame_duration_s, _MCS, _MAC_frame_type, _MAC_ta, _MAC_ra, _manufacturer_ta, _MAC_frame, _CRC, _start_of_packet, _stop_of_packet, _number_of_samples_in_packet); } inline DescrT *Descr::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new DescrT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Descr::UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = global(); if (_e) _o->global = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = annotation(); if (_e) _o->annotation = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = capture(); if (_e) _o->capture = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset Descr::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateDescr(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DescrT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _global = _o->global ? CreateGlobal(_fbb, _o->global.get(), _rehasher) : 0; auto _annotation = _o->annotation ? CreateAnnotation(_fbb, _o->annotation.get(), _rehasher) : 0; auto _capture = _o->capture ? CreateCapture(_fbb, _o->capture.get(), _rehasher) : 0; return sigmf::adsb::CreateDescr( _fbb, _global, _annotation, _capture); } inline const flatbuffers::TypeTable *GlobalTypeTable() { static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr }; return &tt; } inline const flatbuffers::TypeTable *CaptureTypeTable() { static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr }; return &tt; } inline const flatbuffers::TypeTable *AnnotationTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_LONG, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 } }; static const char * const names[] = { "standard", "frame_type_phy", "channel", "start_time_s", "stop_time_s", "frame_duration_s", "MCS", "MAC_frame_type", "MAC_ta", "MAC_ra", "manufacturer_ta", "MAC_frame", "CRC", "start_of_packet", "stop_of_packet", "number_of_samples_in_packet" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 16, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *DescrTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 1 }, { flatbuffers::ET_SEQUENCE, 0, 2 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::adsb::GlobalTypeTable, sigmf::adsb::AnnotationTypeTable, sigmf::adsb::CaptureTypeTable }; static const char * const names[] = { "global", "annotation", "capture" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } } // namespace adsb } // namespace sigmf #endif // FLATBUFFERS_GENERATED_SIGMFADSB_SIGMF_ADSB_H_ libsigmf-1.0.2/sigmf_protocols/sigmf_antenna.fbs000066400000000000000000000013631434644465300220440ustar00rootroot00000000000000 namespace sigmf.antenna; table Global { model:string; type:string; low_frequency:double=null; high_frequency:double=null; gain:double=null; horizontal_gain_pattern:[double]; vertical_gain_pattern:[double]; horizontal_beam_width:double=null; vertical_beam_width:double=null; cross_polar_discrimination:double=null; voltage_standing_wave_ratio:double=null; cable_loss:double=null; steerable:bool=null; mobile:bool=null; hagl:double=null; } table Capture { /*`antenna` does not extend `captures`*/ } table Annotation { azimuth_angle:double=null; elevation_angle:double=null; polarization:string; } table Descr { global:Global; annotation:Annotation; capture:Capture; } libsigmf-1.0.2/sigmf_protocols/sigmf_antenna_generated.h000066400000000000000000000745351434644465300235520ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_SIGMFANTENNA_SIGMF_ANTENNA_H_ #define FLATBUFFERS_GENERATED_SIGMFANTENNA_SIGMF_ANTENNA_H_ #include "flatbuffers/flatbuffers.h" namespace sigmf { namespace antenna { struct Global; struct GlobalBuilder; struct GlobalT; struct Capture; struct CaptureBuilder; struct CaptureT; struct Annotation; struct AnnotationBuilder; struct AnnotationT; struct Descr; struct DescrBuilder; struct DescrT; inline const flatbuffers::TypeTable *GlobalTypeTable(); inline const flatbuffers::TypeTable *CaptureTypeTable(); inline const flatbuffers::TypeTable *AnnotationTypeTable(); inline const flatbuffers::TypeTable *DescrTypeTable(); struct GlobalT : public flatbuffers::NativeTable { typedef Global TableType; std::string model{}; std::string type{}; flatbuffers::Optional low_frequency = flatbuffers::nullopt; flatbuffers::Optional high_frequency = flatbuffers::nullopt; flatbuffers::Optional gain = flatbuffers::nullopt; std::vector horizontal_gain_pattern{}; std::vector vertical_gain_pattern{}; flatbuffers::Optional horizontal_beam_width = flatbuffers::nullopt; flatbuffers::Optional vertical_beam_width = flatbuffers::nullopt; flatbuffers::Optional cross_polar_discrimination = flatbuffers::nullopt; flatbuffers::Optional voltage_standing_wave_ratio = flatbuffers::nullopt; flatbuffers::Optional cable_loss = flatbuffers::nullopt; flatbuffers::Optional steerable = flatbuffers::nullopt; flatbuffers::Optional mobile = flatbuffers::nullopt; flatbuffers::Optional hagl = flatbuffers::nullopt; }; struct Global FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef GlobalT NativeTableType; typedef GlobalBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return GlobalTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_MODEL = 4, VT_TYPE = 6, VT_LOW_FREQUENCY = 8, VT_HIGH_FREQUENCY = 10, VT_GAIN = 12, VT_HORIZONTAL_GAIN_PATTERN = 14, VT_VERTICAL_GAIN_PATTERN = 16, VT_HORIZONTAL_BEAM_WIDTH = 18, VT_VERTICAL_BEAM_WIDTH = 20, VT_CROSS_POLAR_DISCRIMINATION = 22, VT_VOLTAGE_STANDING_WAVE_RATIO = 24, VT_CABLE_LOSS = 26, VT_STEERABLE = 28, VT_MOBILE = 30, VT_HAGL = 32 }; const flatbuffers::String *model() const { return GetPointer(VT_MODEL); } const flatbuffers::String *type() const { return GetPointer(VT_TYPE); } flatbuffers::Optional low_frequency() const { return GetOptional(VT_LOW_FREQUENCY); } flatbuffers::Optional high_frequency() const { return GetOptional(VT_HIGH_FREQUENCY); } flatbuffers::Optional gain() const { return GetOptional(VT_GAIN); } const flatbuffers::Vector *horizontal_gain_pattern() const { return GetPointer *>(VT_HORIZONTAL_GAIN_PATTERN); } const flatbuffers::Vector *vertical_gain_pattern() const { return GetPointer *>(VT_VERTICAL_GAIN_PATTERN); } flatbuffers::Optional horizontal_beam_width() const { return GetOptional(VT_HORIZONTAL_BEAM_WIDTH); } flatbuffers::Optional vertical_beam_width() const { return GetOptional(VT_VERTICAL_BEAM_WIDTH); } flatbuffers::Optional cross_polar_discrimination() const { return GetOptional(VT_CROSS_POLAR_DISCRIMINATION); } flatbuffers::Optional voltage_standing_wave_ratio() const { return GetOptional(VT_VOLTAGE_STANDING_WAVE_RATIO); } flatbuffers::Optional cable_loss() const { return GetOptional(VT_CABLE_LOSS); } flatbuffers::Optional steerable() const { return GetOptional(VT_STEERABLE); } flatbuffers::Optional mobile() const { return GetOptional(VT_MOBILE); } flatbuffers::Optional hagl() const { return GetOptional(VT_HAGL); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_MODEL) && verifier.VerifyString(model()) && VerifyOffset(verifier, VT_TYPE) && verifier.VerifyString(type()) && VerifyField(verifier, VT_LOW_FREQUENCY) && VerifyField(verifier, VT_HIGH_FREQUENCY) && VerifyField(verifier, VT_GAIN) && VerifyOffset(verifier, VT_HORIZONTAL_GAIN_PATTERN) && verifier.VerifyVector(horizontal_gain_pattern()) && VerifyOffset(verifier, VT_VERTICAL_GAIN_PATTERN) && verifier.VerifyVector(vertical_gain_pattern()) && VerifyField(verifier, VT_HORIZONTAL_BEAM_WIDTH) && VerifyField(verifier, VT_VERTICAL_BEAM_WIDTH) && VerifyField(verifier, VT_CROSS_POLAR_DISCRIMINATION) && VerifyField(verifier, VT_VOLTAGE_STANDING_WAVE_RATIO) && VerifyField(verifier, VT_CABLE_LOSS) && VerifyField(verifier, VT_STEERABLE) && VerifyField(verifier, VT_MOBILE) && VerifyField(verifier, VT_HAGL) && verifier.EndTable(); } GlobalT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct GlobalBuilder { typedef Global Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_model(flatbuffers::Offset model) { fbb_.AddOffset(Global::VT_MODEL, model); } void add_type(flatbuffers::Offset type) { fbb_.AddOffset(Global::VT_TYPE, type); } void add_low_frequency(double low_frequency) { fbb_.AddElement(Global::VT_LOW_FREQUENCY, low_frequency); } void add_high_frequency(double high_frequency) { fbb_.AddElement(Global::VT_HIGH_FREQUENCY, high_frequency); } void add_gain(double gain) { fbb_.AddElement(Global::VT_GAIN, gain); } void add_horizontal_gain_pattern(flatbuffers::Offset> horizontal_gain_pattern) { fbb_.AddOffset(Global::VT_HORIZONTAL_GAIN_PATTERN, horizontal_gain_pattern); } void add_vertical_gain_pattern(flatbuffers::Offset> vertical_gain_pattern) { fbb_.AddOffset(Global::VT_VERTICAL_GAIN_PATTERN, vertical_gain_pattern); } void add_horizontal_beam_width(double horizontal_beam_width) { fbb_.AddElement(Global::VT_HORIZONTAL_BEAM_WIDTH, horizontal_beam_width); } void add_vertical_beam_width(double vertical_beam_width) { fbb_.AddElement(Global::VT_VERTICAL_BEAM_WIDTH, vertical_beam_width); } void add_cross_polar_discrimination(double cross_polar_discrimination) { fbb_.AddElement(Global::VT_CROSS_POLAR_DISCRIMINATION, cross_polar_discrimination); } void add_voltage_standing_wave_ratio(double voltage_standing_wave_ratio) { fbb_.AddElement(Global::VT_VOLTAGE_STANDING_WAVE_RATIO, voltage_standing_wave_ratio); } void add_cable_loss(double cable_loss) { fbb_.AddElement(Global::VT_CABLE_LOSS, cable_loss); } void add_steerable(bool steerable) { fbb_.AddElement(Global::VT_STEERABLE, static_cast(steerable)); } void add_mobile(bool mobile) { fbb_.AddElement(Global::VT_MOBILE, static_cast(mobile)); } void add_hagl(double hagl) { fbb_.AddElement(Global::VT_HAGL, hagl); } explicit GlobalBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateGlobal( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset model = 0, flatbuffers::Offset type = 0, flatbuffers::Optional low_frequency = flatbuffers::nullopt, flatbuffers::Optional high_frequency = flatbuffers::nullopt, flatbuffers::Optional gain = flatbuffers::nullopt, flatbuffers::Offset> horizontal_gain_pattern = 0, flatbuffers::Offset> vertical_gain_pattern = 0, flatbuffers::Optional horizontal_beam_width = flatbuffers::nullopt, flatbuffers::Optional vertical_beam_width = flatbuffers::nullopt, flatbuffers::Optional cross_polar_discrimination = flatbuffers::nullopt, flatbuffers::Optional voltage_standing_wave_ratio = flatbuffers::nullopt, flatbuffers::Optional cable_loss = flatbuffers::nullopt, flatbuffers::Optional steerable = flatbuffers::nullopt, flatbuffers::Optional mobile = flatbuffers::nullopt, flatbuffers::Optional hagl = flatbuffers::nullopt) { GlobalBuilder builder_(_fbb); if(hagl) { builder_.add_hagl(*hagl); } if(cable_loss) { builder_.add_cable_loss(*cable_loss); } if(voltage_standing_wave_ratio) { builder_.add_voltage_standing_wave_ratio(*voltage_standing_wave_ratio); } if(cross_polar_discrimination) { builder_.add_cross_polar_discrimination(*cross_polar_discrimination); } if(vertical_beam_width) { builder_.add_vertical_beam_width(*vertical_beam_width); } if(horizontal_beam_width) { builder_.add_horizontal_beam_width(*horizontal_beam_width); } if(gain) { builder_.add_gain(*gain); } if(high_frequency) { builder_.add_high_frequency(*high_frequency); } if(low_frequency) { builder_.add_low_frequency(*low_frequency); } builder_.add_vertical_gain_pattern(vertical_gain_pattern); builder_.add_horizontal_gain_pattern(horizontal_gain_pattern); builder_.add_type(type); builder_.add_model(model); if(mobile) { builder_.add_mobile(*mobile); } if(steerable) { builder_.add_steerable(*steerable); } return builder_.Finish(); } inline flatbuffers::Offset CreateGlobalDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *model = nullptr, const char *type = nullptr, flatbuffers::Optional low_frequency = flatbuffers::nullopt, flatbuffers::Optional high_frequency = flatbuffers::nullopt, flatbuffers::Optional gain = flatbuffers::nullopt, const std::vector *horizontal_gain_pattern = nullptr, const std::vector *vertical_gain_pattern = nullptr, flatbuffers::Optional horizontal_beam_width = flatbuffers::nullopt, flatbuffers::Optional vertical_beam_width = flatbuffers::nullopt, flatbuffers::Optional cross_polar_discrimination = flatbuffers::nullopt, flatbuffers::Optional voltage_standing_wave_ratio = flatbuffers::nullopt, flatbuffers::Optional cable_loss = flatbuffers::nullopt, flatbuffers::Optional steerable = flatbuffers::nullopt, flatbuffers::Optional mobile = flatbuffers::nullopt, flatbuffers::Optional hagl = flatbuffers::nullopt) { auto model__ = model ? _fbb.CreateString(model) : 0; auto type__ = type ? _fbb.CreateString(type) : 0; auto horizontal_gain_pattern__ = horizontal_gain_pattern ? _fbb.CreateVector(*horizontal_gain_pattern) : 0; auto vertical_gain_pattern__ = vertical_gain_pattern ? _fbb.CreateVector(*vertical_gain_pattern) : 0; return sigmf::antenna::CreateGlobal( _fbb, model__, type__, low_frequency, high_frequency, gain, horizontal_gain_pattern__, vertical_gain_pattern__, horizontal_beam_width, vertical_beam_width, cross_polar_discrimination, voltage_standing_wave_ratio, cable_loss, steerable, mobile, hagl); } flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct CaptureT : public flatbuffers::NativeTable { typedef Capture TableType; }; struct Capture FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CaptureT NativeTableType; typedef CaptureBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return CaptureTypeTable(); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } CaptureT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct CaptureBuilder { typedef Capture Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; explicit CaptureBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateCapture( flatbuffers::FlatBufferBuilder &_fbb) { CaptureBuilder builder_(_fbb); return builder_.Finish(); } flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct AnnotationT : public flatbuffers::NativeTable { typedef Annotation TableType; flatbuffers::Optional azimuth_angle = flatbuffers::nullopt; flatbuffers::Optional elevation_angle = flatbuffers::nullopt; std::string polarization{}; }; struct Annotation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef AnnotationT NativeTableType; typedef AnnotationBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return AnnotationTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_AZIMUTH_ANGLE = 4, VT_ELEVATION_ANGLE = 6, VT_POLARIZATION = 8 }; flatbuffers::Optional azimuth_angle() const { return GetOptional(VT_AZIMUTH_ANGLE); } flatbuffers::Optional elevation_angle() const { return GetOptional(VT_ELEVATION_ANGLE); } const flatbuffers::String *polarization() const { return GetPointer(VT_POLARIZATION); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_AZIMUTH_ANGLE) && VerifyField(verifier, VT_ELEVATION_ANGLE) && VerifyOffset(verifier, VT_POLARIZATION) && verifier.VerifyString(polarization()) && verifier.EndTable(); } AnnotationT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct AnnotationBuilder { typedef Annotation Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_azimuth_angle(double azimuth_angle) { fbb_.AddElement(Annotation::VT_AZIMUTH_ANGLE, azimuth_angle); } void add_elevation_angle(double elevation_angle) { fbb_.AddElement(Annotation::VT_ELEVATION_ANGLE, elevation_angle); } void add_polarization(flatbuffers::Offset polarization) { fbb_.AddOffset(Annotation::VT_POLARIZATION, polarization); } explicit AnnotationBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateAnnotation( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional azimuth_angle = flatbuffers::nullopt, flatbuffers::Optional elevation_angle = flatbuffers::nullopt, flatbuffers::Offset polarization = 0) { AnnotationBuilder builder_(_fbb); if(elevation_angle) { builder_.add_elevation_angle(*elevation_angle); } if(azimuth_angle) { builder_.add_azimuth_angle(*azimuth_angle); } builder_.add_polarization(polarization); return builder_.Finish(); } inline flatbuffers::Offset CreateAnnotationDirect( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional azimuth_angle = flatbuffers::nullopt, flatbuffers::Optional elevation_angle = flatbuffers::nullopt, const char *polarization = nullptr) { auto polarization__ = polarization ? _fbb.CreateString(polarization) : 0; return sigmf::antenna::CreateAnnotation( _fbb, azimuth_angle, elevation_angle, polarization__); } flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct DescrT : public flatbuffers::NativeTable { typedef Descr TableType; std::shared_ptr global{}; std::shared_ptr annotation{}; std::shared_ptr capture{}; }; struct Descr FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DescrT NativeTableType; typedef DescrBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return DescrTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_GLOBAL = 4, VT_ANNOTATION = 6, VT_CAPTURE = 8 }; const sigmf::antenna::Global *global() const { return GetPointer(VT_GLOBAL); } const sigmf::antenna::Annotation *annotation() const { return GetPointer(VT_ANNOTATION); } const sigmf::antenna::Capture *capture() const { return GetPointer(VT_CAPTURE); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_GLOBAL) && verifier.VerifyTable(global()) && VerifyOffset(verifier, VT_ANNOTATION) && verifier.VerifyTable(annotation()) && VerifyOffset(verifier, VT_CAPTURE) && verifier.VerifyTable(capture()) && verifier.EndTable(); } DescrT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DescrBuilder { typedef Descr Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_global(flatbuffers::Offset global) { fbb_.AddOffset(Descr::VT_GLOBAL, global); } void add_annotation(flatbuffers::Offset annotation) { fbb_.AddOffset(Descr::VT_ANNOTATION, annotation); } void add_capture(flatbuffers::Offset capture) { fbb_.AddOffset(Descr::VT_CAPTURE, capture); } explicit DescrBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateDescr( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset global = 0, flatbuffers::Offset annotation = 0, flatbuffers::Offset capture = 0) { DescrBuilder builder_(_fbb); builder_.add_capture(capture); builder_.add_annotation(annotation); builder_.add_global(global); return builder_.Finish(); } flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); inline GlobalT *Global::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new GlobalT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Global::UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = model(); if (_e) _o->model = _e->str(); } { auto _e = type(); if (_e) _o->type = _e->str(); } { auto _e = low_frequency(); _o->low_frequency = _e; } { auto _e = high_frequency(); _o->high_frequency = _e; } { auto _e = gain(); _o->gain = _e; } { auto _e = horizontal_gain_pattern(); if (_e) { _o->horizontal_gain_pattern.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->horizontal_gain_pattern[_i] = _e->Get(_i); } } } { auto _e = vertical_gain_pattern(); if (_e) { _o->vertical_gain_pattern.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vertical_gain_pattern[_i] = _e->Get(_i); } } } { auto _e = horizontal_beam_width(); _o->horizontal_beam_width = _e; } { auto _e = vertical_beam_width(); _o->vertical_beam_width = _e; } { auto _e = cross_polar_discrimination(); _o->cross_polar_discrimination = _e; } { auto _e = voltage_standing_wave_ratio(); _o->voltage_standing_wave_ratio = _e; } { auto _e = cable_loss(); _o->cable_loss = _e; } { auto _e = steerable(); _o->steerable = _e; } { auto _e = mobile(); _o->mobile = _e; } { auto _e = hagl(); _o->hagl = _e; } } inline flatbuffers::Offset Global::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateGlobal(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GlobalT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _model = _o->model.empty() ? 0 : _fbb.CreateString(_o->model); auto _type = _o->type.empty() ? 0 : _fbb.CreateString(_o->type); auto _low_frequency = _o->low_frequency; auto _high_frequency = _o->high_frequency; auto _gain = _o->gain; auto _horizontal_gain_pattern = _o->horizontal_gain_pattern.size() ? _fbb.CreateVector(_o->horizontal_gain_pattern) : 0; auto _vertical_gain_pattern = _o->vertical_gain_pattern.size() ? _fbb.CreateVector(_o->vertical_gain_pattern) : 0; auto _horizontal_beam_width = _o->horizontal_beam_width; auto _vertical_beam_width = _o->vertical_beam_width; auto _cross_polar_discrimination = _o->cross_polar_discrimination; auto _voltage_standing_wave_ratio = _o->voltage_standing_wave_ratio; auto _cable_loss = _o->cable_loss; auto _steerable = _o->steerable; auto _mobile = _o->mobile; auto _hagl = _o->hagl; return sigmf::antenna::CreateGlobal( _fbb, _model, _type, _low_frequency, _high_frequency, _gain, _horizontal_gain_pattern, _vertical_gain_pattern, _horizontal_beam_width, _vertical_beam_width, _cross_polar_discrimination, _voltage_standing_wave_ratio, _cable_loss, _steerable, _mobile, _hagl); } inline CaptureT *Capture::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new CaptureT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Capture::UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; } inline flatbuffers::Offset Capture::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateCapture(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CaptureT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; return sigmf::antenna::CreateCapture( _fbb); } inline AnnotationT *Annotation::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new AnnotationT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Annotation::UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = azimuth_angle(); _o->azimuth_angle = _e; } { auto _e = elevation_angle(); _o->elevation_angle = _e; } { auto _e = polarization(); if (_e) _o->polarization = _e->str(); } } inline flatbuffers::Offset Annotation::Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateAnnotation(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const AnnotationT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _azimuth_angle = _o->azimuth_angle; auto _elevation_angle = _o->elevation_angle; auto _polarization = _o->polarization.empty() ? 0 : _fbb.CreateString(_o->polarization); return sigmf::antenna::CreateAnnotation( _fbb, _azimuth_angle, _elevation_angle, _polarization); } inline DescrT *Descr::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new DescrT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Descr::UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = global(); if (_e) _o->global = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = annotation(); if (_e) _o->annotation = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = capture(); if (_e) _o->capture = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset Descr::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateDescr(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DescrT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _global = _o->global ? CreateGlobal(_fbb, _o->global.get(), _rehasher) : 0; auto _annotation = _o->annotation ? CreateAnnotation(_fbb, _o->annotation.get(), _rehasher) : 0; auto _capture = _o->capture ? CreateCapture(_fbb, _o->capture.get(), _rehasher) : 0; return sigmf::antenna::CreateDescr( _fbb, _global, _annotation, _capture); } inline const flatbuffers::TypeTable *GlobalTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 1, -1 }, { flatbuffers::ET_DOUBLE, 1, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_BOOL, 0, -1 }, { flatbuffers::ET_BOOL, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 } }; static const char * const names[] = { "model", "type", "low_frequency", "high_frequency", "gain", "horizontal_gain_pattern", "vertical_gain_pattern", "horizontal_beam_width", "vertical_beam_width", "cross_polar_discrimination", "voltage_standing_wave_ratio", "cable_loss", "steerable", "mobile", "hagl" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 15, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *CaptureTypeTable() { static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr }; return &tt; } inline const flatbuffers::TypeTable *AnnotationTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 } }; static const char * const names[] = { "azimuth_angle", "elevation_angle", "polarization" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 3, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *DescrTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 1 }, { flatbuffers::ET_SEQUENCE, 0, 2 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::antenna::GlobalTypeTable, sigmf::antenna::AnnotationTypeTable, sigmf::antenna::CaptureTypeTable }; static const char * const names[] = { "global", "annotation", "capture" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } } // namespace antenna } // namespace sigmf #endif // FLATBUFFERS_GENERATED_SIGMFANTENNA_SIGMF_ANTENNA_H_ libsigmf-1.0.2/sigmf_protocols/sigmf_capture_details.fbs000066400000000000000000000007471434644465300235750ustar00rootroot00000000000000 namespace sigmf.capture_details; table Global { /*`capture_details` does not extend `global`*/ } table Capture { acq_scale_factor:double=null; attentuation:double=null; acquisition_bandwidth:double=null; start_capture:string; stop_capture:string; source_file:string; gain:double=null; } table Annotation { SNRdB:double=null; signal_reference_number:ulong=null; } table Descr { global:Global; annotation:Annotation; capture:Capture; } libsigmf-1.0.2/sigmf_protocols/sigmf_capture_details_generated.h000066400000000000000000000543541434644465300252730ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_SIGMFCAPTUREDETAILS_SIGMF_CAPTURE_DETAILS_H_ #define FLATBUFFERS_GENERATED_SIGMFCAPTUREDETAILS_SIGMF_CAPTURE_DETAILS_H_ #include "flatbuffers/flatbuffers.h" namespace sigmf { namespace capture_details { struct Global; struct GlobalBuilder; struct GlobalT; struct Capture; struct CaptureBuilder; struct CaptureT; struct Annotation; struct AnnotationBuilder; struct AnnotationT; struct Descr; struct DescrBuilder; struct DescrT; inline const flatbuffers::TypeTable *GlobalTypeTable(); inline const flatbuffers::TypeTable *CaptureTypeTable(); inline const flatbuffers::TypeTable *AnnotationTypeTable(); inline const flatbuffers::TypeTable *DescrTypeTable(); struct GlobalT : public flatbuffers::NativeTable { typedef Global TableType; }; struct Global FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef GlobalT NativeTableType; typedef GlobalBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return GlobalTypeTable(); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } GlobalT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct GlobalBuilder { typedef Global Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; explicit GlobalBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateGlobal( flatbuffers::FlatBufferBuilder &_fbb) { GlobalBuilder builder_(_fbb); return builder_.Finish(); } flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct CaptureT : public flatbuffers::NativeTable { typedef Capture TableType; flatbuffers::Optional acq_scale_factor = flatbuffers::nullopt; flatbuffers::Optional attentuation = flatbuffers::nullopt; flatbuffers::Optional acquisition_bandwidth = flatbuffers::nullopt; std::string start_capture{}; std::string stop_capture{}; std::string source_file{}; flatbuffers::Optional gain = flatbuffers::nullopt; }; struct Capture FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CaptureT NativeTableType; typedef CaptureBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return CaptureTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_ACQ_SCALE_FACTOR = 4, VT_ATTENTUATION = 6, VT_ACQUISITION_BANDWIDTH = 8, VT_START_CAPTURE = 10, VT_STOP_CAPTURE = 12, VT_SOURCE_FILE = 14, VT_GAIN = 16 }; flatbuffers::Optional acq_scale_factor() const { return GetOptional(VT_ACQ_SCALE_FACTOR); } flatbuffers::Optional attentuation() const { return GetOptional(VT_ATTENTUATION); } flatbuffers::Optional acquisition_bandwidth() const { return GetOptional(VT_ACQUISITION_BANDWIDTH); } const flatbuffers::String *start_capture() const { return GetPointer(VT_START_CAPTURE); } const flatbuffers::String *stop_capture() const { return GetPointer(VT_STOP_CAPTURE); } const flatbuffers::String *source_file() const { return GetPointer(VT_SOURCE_FILE); } flatbuffers::Optional gain() const { return GetOptional(VT_GAIN); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_ACQ_SCALE_FACTOR) && VerifyField(verifier, VT_ATTENTUATION) && VerifyField(verifier, VT_ACQUISITION_BANDWIDTH) && VerifyOffset(verifier, VT_START_CAPTURE) && verifier.VerifyString(start_capture()) && VerifyOffset(verifier, VT_STOP_CAPTURE) && verifier.VerifyString(stop_capture()) && VerifyOffset(verifier, VT_SOURCE_FILE) && verifier.VerifyString(source_file()) && VerifyField(verifier, VT_GAIN) && verifier.EndTable(); } CaptureT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct CaptureBuilder { typedef Capture Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_acq_scale_factor(double acq_scale_factor) { fbb_.AddElement(Capture::VT_ACQ_SCALE_FACTOR, acq_scale_factor); } void add_attentuation(double attentuation) { fbb_.AddElement(Capture::VT_ATTENTUATION, attentuation); } void add_acquisition_bandwidth(double acquisition_bandwidth) { fbb_.AddElement(Capture::VT_ACQUISITION_BANDWIDTH, acquisition_bandwidth); } void add_start_capture(flatbuffers::Offset start_capture) { fbb_.AddOffset(Capture::VT_START_CAPTURE, start_capture); } void add_stop_capture(flatbuffers::Offset stop_capture) { fbb_.AddOffset(Capture::VT_STOP_CAPTURE, stop_capture); } void add_source_file(flatbuffers::Offset source_file) { fbb_.AddOffset(Capture::VT_SOURCE_FILE, source_file); } void add_gain(double gain) { fbb_.AddElement(Capture::VT_GAIN, gain); } explicit CaptureBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateCapture( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional acq_scale_factor = flatbuffers::nullopt, flatbuffers::Optional attentuation = flatbuffers::nullopt, flatbuffers::Optional acquisition_bandwidth = flatbuffers::nullopt, flatbuffers::Offset start_capture = 0, flatbuffers::Offset stop_capture = 0, flatbuffers::Offset source_file = 0, flatbuffers::Optional gain = flatbuffers::nullopt) { CaptureBuilder builder_(_fbb); if(gain) { builder_.add_gain(*gain); } if(acquisition_bandwidth) { builder_.add_acquisition_bandwidth(*acquisition_bandwidth); } if(attentuation) { builder_.add_attentuation(*attentuation); } if(acq_scale_factor) { builder_.add_acq_scale_factor(*acq_scale_factor); } builder_.add_source_file(source_file); builder_.add_stop_capture(stop_capture); builder_.add_start_capture(start_capture); return builder_.Finish(); } inline flatbuffers::Offset CreateCaptureDirect( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional acq_scale_factor = flatbuffers::nullopt, flatbuffers::Optional attentuation = flatbuffers::nullopt, flatbuffers::Optional acquisition_bandwidth = flatbuffers::nullopt, const char *start_capture = nullptr, const char *stop_capture = nullptr, const char *source_file = nullptr, flatbuffers::Optional gain = flatbuffers::nullopt) { auto start_capture__ = start_capture ? _fbb.CreateString(start_capture) : 0; auto stop_capture__ = stop_capture ? _fbb.CreateString(stop_capture) : 0; auto source_file__ = source_file ? _fbb.CreateString(source_file) : 0; return sigmf::capture_details::CreateCapture( _fbb, acq_scale_factor, attentuation, acquisition_bandwidth, start_capture__, stop_capture__, source_file__, gain); } flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct AnnotationT : public flatbuffers::NativeTable { typedef Annotation TableType; flatbuffers::Optional SNRdB = flatbuffers::nullopt; flatbuffers::Optional signal_reference_number = flatbuffers::nullopt; }; struct Annotation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef AnnotationT NativeTableType; typedef AnnotationBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return AnnotationTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SNRDB = 4, VT_SIGNAL_REFERENCE_NUMBER = 6 }; flatbuffers::Optional SNRdB() const { return GetOptional(VT_SNRDB); } flatbuffers::Optional signal_reference_number() const { return GetOptional(VT_SIGNAL_REFERENCE_NUMBER); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_SNRDB) && VerifyField(verifier, VT_SIGNAL_REFERENCE_NUMBER) && verifier.EndTable(); } AnnotationT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct AnnotationBuilder { typedef Annotation Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_SNRdB(double SNRdB) { fbb_.AddElement(Annotation::VT_SNRDB, SNRdB); } void add_signal_reference_number(uint64_t signal_reference_number) { fbb_.AddElement(Annotation::VT_SIGNAL_REFERENCE_NUMBER, signal_reference_number); } explicit AnnotationBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateAnnotation( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional SNRdB = flatbuffers::nullopt, flatbuffers::Optional signal_reference_number = flatbuffers::nullopt) { AnnotationBuilder builder_(_fbb); if(signal_reference_number) { builder_.add_signal_reference_number(*signal_reference_number); } if(SNRdB) { builder_.add_SNRdB(*SNRdB); } return builder_.Finish(); } flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct DescrT : public flatbuffers::NativeTable { typedef Descr TableType; std::shared_ptr global{}; std::shared_ptr annotation{}; std::shared_ptr capture{}; }; struct Descr FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DescrT NativeTableType; typedef DescrBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return DescrTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_GLOBAL = 4, VT_ANNOTATION = 6, VT_CAPTURE = 8 }; const sigmf::capture_details::Global *global() const { return GetPointer(VT_GLOBAL); } const sigmf::capture_details::Annotation *annotation() const { return GetPointer(VT_ANNOTATION); } const sigmf::capture_details::Capture *capture() const { return GetPointer(VT_CAPTURE); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_GLOBAL) && verifier.VerifyTable(global()) && VerifyOffset(verifier, VT_ANNOTATION) && verifier.VerifyTable(annotation()) && VerifyOffset(verifier, VT_CAPTURE) && verifier.VerifyTable(capture()) && verifier.EndTable(); } DescrT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DescrBuilder { typedef Descr Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_global(flatbuffers::Offset global) { fbb_.AddOffset(Descr::VT_GLOBAL, global); } void add_annotation(flatbuffers::Offset annotation) { fbb_.AddOffset(Descr::VT_ANNOTATION, annotation); } void add_capture(flatbuffers::Offset capture) { fbb_.AddOffset(Descr::VT_CAPTURE, capture); } explicit DescrBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateDescr( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset global = 0, flatbuffers::Offset annotation = 0, flatbuffers::Offset capture = 0) { DescrBuilder builder_(_fbb); builder_.add_capture(capture); builder_.add_annotation(annotation); builder_.add_global(global); return builder_.Finish(); } flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); inline GlobalT *Global::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new GlobalT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Global::UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; } inline flatbuffers::Offset Global::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateGlobal(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GlobalT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; return sigmf::capture_details::CreateGlobal( _fbb); } inline CaptureT *Capture::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new CaptureT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Capture::UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = acq_scale_factor(); _o->acq_scale_factor = _e; } { auto _e = attentuation(); _o->attentuation = _e; } { auto _e = acquisition_bandwidth(); _o->acquisition_bandwidth = _e; } { auto _e = start_capture(); if (_e) _o->start_capture = _e->str(); } { auto _e = stop_capture(); if (_e) _o->stop_capture = _e->str(); } { auto _e = source_file(); if (_e) _o->source_file = _e->str(); } { auto _e = gain(); _o->gain = _e; } } inline flatbuffers::Offset Capture::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateCapture(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CaptureT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _acq_scale_factor = _o->acq_scale_factor; auto _attentuation = _o->attentuation; auto _acquisition_bandwidth = _o->acquisition_bandwidth; auto _start_capture = _o->start_capture.empty() ? 0 : _fbb.CreateString(_o->start_capture); auto _stop_capture = _o->stop_capture.empty() ? 0 : _fbb.CreateString(_o->stop_capture); auto _source_file = _o->source_file.empty() ? 0 : _fbb.CreateString(_o->source_file); auto _gain = _o->gain; return sigmf::capture_details::CreateCapture( _fbb, _acq_scale_factor, _attentuation, _acquisition_bandwidth, _start_capture, _stop_capture, _source_file, _gain); } inline AnnotationT *Annotation::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new AnnotationT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Annotation::UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = SNRdB(); _o->SNRdB = _e; } { auto _e = signal_reference_number(); _o->signal_reference_number = _e; } } inline flatbuffers::Offset Annotation::Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateAnnotation(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const AnnotationT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _SNRdB = _o->SNRdB; auto _signal_reference_number = _o->signal_reference_number; return sigmf::capture_details::CreateAnnotation( _fbb, _SNRdB, _signal_reference_number); } inline DescrT *Descr::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new DescrT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Descr::UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = global(); if (_e) _o->global = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = annotation(); if (_e) _o->annotation = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = capture(); if (_e) _o->capture = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset Descr::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateDescr(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DescrT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _global = _o->global ? CreateGlobal(_fbb, _o->global.get(), _rehasher) : 0; auto _annotation = _o->annotation ? CreateAnnotation(_fbb, _o->annotation.get(), _rehasher) : 0; auto _capture = _o->capture ? CreateCapture(_fbb, _o->capture.get(), _rehasher) : 0; return sigmf::capture_details::CreateDescr( _fbb, _global, _annotation, _capture); } inline const flatbuffers::TypeTable *GlobalTypeTable() { static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr }; return &tt; } inline const flatbuffers::TypeTable *CaptureTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 } }; static const char * const names[] = { "acq_scale_factor", "attentuation", "acquisition_bandwidth", "start_capture", "stop_capture", "source_file", "gain" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 7, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *AnnotationTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_ULONG, 0, -1 } }; static const char * const names[] = { "SNRdB", "signal_reference_number" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 2, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *DescrTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 1 }, { flatbuffers::ET_SEQUENCE, 0, 2 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::capture_details::GlobalTypeTable, sigmf::capture_details::AnnotationTypeTable, sigmf::capture_details::CaptureTypeTable }; static const char * const names[] = { "global", "annotation", "capture" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } } // namespace capture_details } // namespace sigmf #endif // FLATBUFFERS_GENERATED_SIGMFCAPTUREDETAILS_SIGMF_CAPTURE_DETAILS_H_ libsigmf-1.0.2/sigmf_protocols/sigmf_core.fbs000066400000000000000000000031221434644465300213430ustar00rootroot00000000000000 namespace sigmf.core; table sigmf_extension { name:string; version:string; optional:bool=null; } table sigmf_stream { name:string; hash:string; } table geojson_point { type:string; coordinates:[double]; } table Global { datatype:string; sample_rate:double=null; version:string; num_channels:ulong=null; sha512:string; offset:ulong=null; description:string; author:string; meta_doi:string; data_doi:string; recorder:string; license:string; hw:string; dataset:string; trailing_bytes:ulong=null; metadata_only:bool=null; geolocation:geojson_point; extensions:[sigmf_extension]; collection:string; } table Capture { sample_start:ulong=null; global_index:ulong=null; header_bytes:ulong=null; frequency:double=null; datetime:string; } table Annotation { sample_start:ulong=null; sample_count:ulong=null; generator:string; description:string; // not defined by SigMF; included for compatibility - use `label` label:string; comment:string; freq_lower_edge:double=null; freq_upper_edge:double=null; latitude:double=null; // deprecated, use the `global` `geolocation` field longitude:double=null; // deprecated, use the `global` `geolocation` field } table Collection { version:string; description:string; author:string; collection_doi:string; license:string; extensions:[sigmf_extension]; streams:[sigmf_stream]; } table Descr { global:Global; annotation:Annotation; capture:Capture; collection:Collection; } libsigmf-1.0.2/sigmf_protocols/sigmf_core_generated.h000066400000000000000000002131311434644465300230410ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_SIGMFCORE_SIGMF_CORE_H_ #define FLATBUFFERS_GENERATED_SIGMFCORE_SIGMF_CORE_H_ #include "flatbuffers/flatbuffers.h" namespace sigmf { namespace core { struct sigmf_extension; struct sigmf_extensionBuilder; struct sigmf_extensionT; struct sigmf_stream; struct sigmf_streamBuilder; struct sigmf_streamT; struct geojson_point; struct geojson_pointBuilder; struct geojson_pointT; struct Global; struct GlobalBuilder; struct GlobalT; struct Capture; struct CaptureBuilder; struct CaptureT; struct Annotation; struct AnnotationBuilder; struct AnnotationT; struct Collection; struct CollectionBuilder; struct CollectionT; struct Descr; struct DescrBuilder; struct DescrT; inline const flatbuffers::TypeTable *sigmf_extensionTypeTable(); inline const flatbuffers::TypeTable *sigmf_streamTypeTable(); inline const flatbuffers::TypeTable *geojson_pointTypeTable(); inline const flatbuffers::TypeTable *GlobalTypeTable(); inline const flatbuffers::TypeTable *CaptureTypeTable(); inline const flatbuffers::TypeTable *AnnotationTypeTable(); inline const flatbuffers::TypeTable *CollectionTypeTable(); inline const flatbuffers::TypeTable *DescrTypeTable(); struct sigmf_extensionT : public flatbuffers::NativeTable { typedef sigmf_extension TableType; std::string name{}; std::string version{}; flatbuffers::Optional optional = flatbuffers::nullopt; }; struct sigmf_extension FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef sigmf_extensionT NativeTableType; typedef sigmf_extensionBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return sigmf_extensionTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_NAME = 4, VT_VERSION = 6, VT_OPTIONAL = 8 }; const flatbuffers::String *name() const { return GetPointer(VT_NAME); } const flatbuffers::String *version() const { return GetPointer(VT_VERSION); } flatbuffers::Optional optional() const { return GetOptional(VT_OPTIONAL); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_NAME) && verifier.VerifyString(name()) && VerifyOffset(verifier, VT_VERSION) && verifier.VerifyString(version()) && VerifyField(verifier, VT_OPTIONAL) && verifier.EndTable(); } sigmf_extensionT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(sigmf_extensionT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_extensionT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct sigmf_extensionBuilder { typedef sigmf_extension Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_name(flatbuffers::Offset name) { fbb_.AddOffset(sigmf_extension::VT_NAME, name); } void add_version(flatbuffers::Offset version) { fbb_.AddOffset(sigmf_extension::VT_VERSION, version); } void add_optional(bool optional) { fbb_.AddElement(sigmf_extension::VT_OPTIONAL, static_cast(optional)); } explicit sigmf_extensionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createsigmf_extension( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset name = 0, flatbuffers::Offset version = 0, flatbuffers::Optional optional = flatbuffers::nullopt) { sigmf_extensionBuilder builder_(_fbb); builder_.add_version(version); builder_.add_name(name); if(optional) { builder_.add_optional(*optional); } return builder_.Finish(); } inline flatbuffers::Offset Createsigmf_extensionDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *name = nullptr, const char *version = nullptr, flatbuffers::Optional optional = flatbuffers::nullopt) { auto name__ = name ? _fbb.CreateString(name) : 0; auto version__ = version ? _fbb.CreateString(version) : 0; return sigmf::core::Createsigmf_extension( _fbb, name__, version__, optional); } flatbuffers::Offset Createsigmf_extension(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_extensionT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct sigmf_streamT : public flatbuffers::NativeTable { typedef sigmf_stream TableType; std::string name{}; std::string hash{}; }; struct sigmf_stream FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef sigmf_streamT NativeTableType; typedef sigmf_streamBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return sigmf_streamTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_NAME = 4, VT_HASH = 6 }; const flatbuffers::String *name() const { return GetPointer(VT_NAME); } const flatbuffers::String *hash() const { return GetPointer(VT_HASH); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_NAME) && verifier.VerifyString(name()) && VerifyOffset(verifier, VT_HASH) && verifier.VerifyString(hash()) && verifier.EndTable(); } sigmf_streamT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(sigmf_streamT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_streamT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct sigmf_streamBuilder { typedef sigmf_stream Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_name(flatbuffers::Offset name) { fbb_.AddOffset(sigmf_stream::VT_NAME, name); } void add_hash(flatbuffers::Offset hash) { fbb_.AddOffset(sigmf_stream::VT_HASH, hash); } explicit sigmf_streamBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createsigmf_stream( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset name = 0, flatbuffers::Offset hash = 0) { sigmf_streamBuilder builder_(_fbb); builder_.add_hash(hash); builder_.add_name(name); return builder_.Finish(); } inline flatbuffers::Offset Createsigmf_streamDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *name = nullptr, const char *hash = nullptr) { auto name__ = name ? _fbb.CreateString(name) : 0; auto hash__ = hash ? _fbb.CreateString(hash) : 0; return sigmf::core::Createsigmf_stream( _fbb, name__, hash__); } flatbuffers::Offset Createsigmf_stream(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_streamT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct geojson_pointT : public flatbuffers::NativeTable { typedef geojson_point TableType; std::string type{}; std::vector coordinates{}; }; struct geojson_point FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef geojson_pointT NativeTableType; typedef geojson_pointBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return geojson_pointTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_TYPE = 4, VT_COORDINATES = 6 }; const flatbuffers::String *type() const { return GetPointer(VT_TYPE); } const flatbuffers::Vector *coordinates() const { return GetPointer *>(VT_COORDINATES); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_TYPE) && verifier.VerifyString(type()) && VerifyOffset(verifier, VT_COORDINATES) && verifier.VerifyVector(coordinates()) && verifier.EndTable(); } geojson_pointT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(geojson_pointT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const geojson_pointT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct geojson_pointBuilder { typedef geojson_point Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_type(flatbuffers::Offset type) { fbb_.AddOffset(geojson_point::VT_TYPE, type); } void add_coordinates(flatbuffers::Offset> coordinates) { fbb_.AddOffset(geojson_point::VT_COORDINATES, coordinates); } explicit geojson_pointBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Creategeojson_point( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset type = 0, flatbuffers::Offset> coordinates = 0) { geojson_pointBuilder builder_(_fbb); builder_.add_coordinates(coordinates); builder_.add_type(type); return builder_.Finish(); } inline flatbuffers::Offset Creategeojson_pointDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *type = nullptr, const std::vector *coordinates = nullptr) { auto type__ = type ? _fbb.CreateString(type) : 0; auto coordinates__ = coordinates ? _fbb.CreateVector(*coordinates) : 0; return sigmf::core::Creategeojson_point( _fbb, type__, coordinates__); } flatbuffers::Offset Creategeojson_point(flatbuffers::FlatBufferBuilder &_fbb, const geojson_pointT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct GlobalT : public flatbuffers::NativeTable { typedef Global TableType; std::string datatype{}; flatbuffers::Optional sample_rate = flatbuffers::nullopt; std::string version{}; flatbuffers::Optional num_channels = flatbuffers::nullopt; std::string sha512{}; flatbuffers::Optional offset = flatbuffers::nullopt; std::string description{}; std::string author{}; std::string meta_doi{}; std::string data_doi{}; std::string recorder{}; std::string license{}; std::string hw{}; std::string dataset{}; flatbuffers::Optional trailing_bytes = flatbuffers::nullopt; flatbuffers::Optional metadata_only = flatbuffers::nullopt; std::shared_ptr geolocation{}; std::vector> extensions{}; std::string collection{}; }; struct Global FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef GlobalT NativeTableType; typedef GlobalBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return GlobalTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_DATATYPE = 4, VT_SAMPLE_RATE = 6, VT_VERSION = 8, VT_NUM_CHANNELS = 10, VT_SHA512 = 12, VT_OFFSET = 14, VT_DESCRIPTION = 16, VT_AUTHOR = 18, VT_META_DOI = 20, VT_DATA_DOI = 22, VT_RECORDER = 24, VT_LICENSE = 26, VT_HW = 28, VT_DATASET = 30, VT_TRAILING_BYTES = 32, VT_METADATA_ONLY = 34, VT_GEOLOCATION = 36, VT_EXTENSIONS = 38, VT_COLLECTION = 40 }; const flatbuffers::String *datatype() const { return GetPointer(VT_DATATYPE); } flatbuffers::Optional sample_rate() const { return GetOptional(VT_SAMPLE_RATE); } const flatbuffers::String *version() const { return GetPointer(VT_VERSION); } flatbuffers::Optional num_channels() const { return GetOptional(VT_NUM_CHANNELS); } const flatbuffers::String *sha512() const { return GetPointer(VT_SHA512); } flatbuffers::Optional offset() const { return GetOptional(VT_OFFSET); } const flatbuffers::String *description() const { return GetPointer(VT_DESCRIPTION); } const flatbuffers::String *author() const { return GetPointer(VT_AUTHOR); } const flatbuffers::String *meta_doi() const { return GetPointer(VT_META_DOI); } const flatbuffers::String *data_doi() const { return GetPointer(VT_DATA_DOI); } const flatbuffers::String *recorder() const { return GetPointer(VT_RECORDER); } const flatbuffers::String *license() const { return GetPointer(VT_LICENSE); } const flatbuffers::String *hw() const { return GetPointer(VT_HW); } const flatbuffers::String *dataset() const { return GetPointer(VT_DATASET); } flatbuffers::Optional trailing_bytes() const { return GetOptional(VT_TRAILING_BYTES); } flatbuffers::Optional metadata_only() const { return GetOptional(VT_METADATA_ONLY); } const sigmf::core::geojson_point *geolocation() const { return GetPointer(VT_GEOLOCATION); } const flatbuffers::Vector> *extensions() const { return GetPointer> *>(VT_EXTENSIONS); } const flatbuffers::String *collection() const { return GetPointer(VT_COLLECTION); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_DATATYPE) && verifier.VerifyString(datatype()) && VerifyField(verifier, VT_SAMPLE_RATE) && VerifyOffset(verifier, VT_VERSION) && verifier.VerifyString(version()) && VerifyField(verifier, VT_NUM_CHANNELS) && VerifyOffset(verifier, VT_SHA512) && verifier.VerifyString(sha512()) && VerifyField(verifier, VT_OFFSET) && VerifyOffset(verifier, VT_DESCRIPTION) && verifier.VerifyString(description()) && VerifyOffset(verifier, VT_AUTHOR) && verifier.VerifyString(author()) && VerifyOffset(verifier, VT_META_DOI) && verifier.VerifyString(meta_doi()) && VerifyOffset(verifier, VT_DATA_DOI) && verifier.VerifyString(data_doi()) && VerifyOffset(verifier, VT_RECORDER) && verifier.VerifyString(recorder()) && VerifyOffset(verifier, VT_LICENSE) && verifier.VerifyString(license()) && VerifyOffset(verifier, VT_HW) && verifier.VerifyString(hw()) && VerifyOffset(verifier, VT_DATASET) && verifier.VerifyString(dataset()) && VerifyField(verifier, VT_TRAILING_BYTES) && VerifyField(verifier, VT_METADATA_ONLY) && VerifyOffset(verifier, VT_GEOLOCATION) && verifier.VerifyTable(geolocation()) && VerifyOffset(verifier, VT_EXTENSIONS) && verifier.VerifyVector(extensions()) && verifier.VerifyVectorOfTables(extensions()) && VerifyOffset(verifier, VT_COLLECTION) && verifier.VerifyString(collection()) && verifier.EndTable(); } GlobalT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct GlobalBuilder { typedef Global Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_datatype(flatbuffers::Offset datatype) { fbb_.AddOffset(Global::VT_DATATYPE, datatype); } void add_sample_rate(double sample_rate) { fbb_.AddElement(Global::VT_SAMPLE_RATE, sample_rate); } void add_version(flatbuffers::Offset version) { fbb_.AddOffset(Global::VT_VERSION, version); } void add_num_channels(uint64_t num_channels) { fbb_.AddElement(Global::VT_NUM_CHANNELS, num_channels); } void add_sha512(flatbuffers::Offset sha512) { fbb_.AddOffset(Global::VT_SHA512, sha512); } void add_offset(uint64_t offset) { fbb_.AddElement(Global::VT_OFFSET, offset); } void add_description(flatbuffers::Offset description) { fbb_.AddOffset(Global::VT_DESCRIPTION, description); } void add_author(flatbuffers::Offset author) { fbb_.AddOffset(Global::VT_AUTHOR, author); } void add_meta_doi(flatbuffers::Offset meta_doi) { fbb_.AddOffset(Global::VT_META_DOI, meta_doi); } void add_data_doi(flatbuffers::Offset data_doi) { fbb_.AddOffset(Global::VT_DATA_DOI, data_doi); } void add_recorder(flatbuffers::Offset recorder) { fbb_.AddOffset(Global::VT_RECORDER, recorder); } void add_license(flatbuffers::Offset license) { fbb_.AddOffset(Global::VT_LICENSE, license); } void add_hw(flatbuffers::Offset hw) { fbb_.AddOffset(Global::VT_HW, hw); } void add_dataset(flatbuffers::Offset dataset) { fbb_.AddOffset(Global::VT_DATASET, dataset); } void add_trailing_bytes(uint64_t trailing_bytes) { fbb_.AddElement(Global::VT_TRAILING_BYTES, trailing_bytes); } void add_metadata_only(bool metadata_only) { fbb_.AddElement(Global::VT_METADATA_ONLY, static_cast(metadata_only)); } void add_geolocation(flatbuffers::Offset geolocation) { fbb_.AddOffset(Global::VT_GEOLOCATION, geolocation); } void add_extensions(flatbuffers::Offset>> extensions) { fbb_.AddOffset(Global::VT_EXTENSIONS, extensions); } void add_collection(flatbuffers::Offset collection) { fbb_.AddOffset(Global::VT_COLLECTION, collection); } explicit GlobalBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateGlobal( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset datatype = 0, flatbuffers::Optional sample_rate = flatbuffers::nullopt, flatbuffers::Offset version = 0, flatbuffers::Optional num_channels = flatbuffers::nullopt, flatbuffers::Offset sha512 = 0, flatbuffers::Optional offset = flatbuffers::nullopt, flatbuffers::Offset description = 0, flatbuffers::Offset author = 0, flatbuffers::Offset meta_doi = 0, flatbuffers::Offset data_doi = 0, flatbuffers::Offset recorder = 0, flatbuffers::Offset license = 0, flatbuffers::Offset hw = 0, flatbuffers::Offset dataset = 0, flatbuffers::Optional trailing_bytes = flatbuffers::nullopt, flatbuffers::Optional metadata_only = flatbuffers::nullopt, flatbuffers::Offset geolocation = 0, flatbuffers::Offset>> extensions = 0, flatbuffers::Offset collection = 0) { GlobalBuilder builder_(_fbb); if(trailing_bytes) { builder_.add_trailing_bytes(*trailing_bytes); } if(offset) { builder_.add_offset(*offset); } if(num_channels) { builder_.add_num_channels(*num_channels); } if(sample_rate) { builder_.add_sample_rate(*sample_rate); } builder_.add_collection(collection); builder_.add_extensions(extensions); builder_.add_geolocation(geolocation); builder_.add_dataset(dataset); builder_.add_hw(hw); builder_.add_license(license); builder_.add_recorder(recorder); builder_.add_data_doi(data_doi); builder_.add_meta_doi(meta_doi); builder_.add_author(author); builder_.add_description(description); builder_.add_sha512(sha512); builder_.add_version(version); builder_.add_datatype(datatype); if(metadata_only) { builder_.add_metadata_only(*metadata_only); } return builder_.Finish(); } inline flatbuffers::Offset CreateGlobalDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *datatype = nullptr, flatbuffers::Optional sample_rate = flatbuffers::nullopt, const char *version = nullptr, flatbuffers::Optional num_channels = flatbuffers::nullopt, const char *sha512 = nullptr, flatbuffers::Optional offset = flatbuffers::nullopt, const char *description = nullptr, const char *author = nullptr, const char *meta_doi = nullptr, const char *data_doi = nullptr, const char *recorder = nullptr, const char *license = nullptr, const char *hw = nullptr, const char *dataset = nullptr, flatbuffers::Optional trailing_bytes = flatbuffers::nullopt, flatbuffers::Optional metadata_only = flatbuffers::nullopt, flatbuffers::Offset geolocation = 0, const std::vector> *extensions = nullptr, const char *collection = nullptr) { auto datatype__ = datatype ? _fbb.CreateString(datatype) : 0; auto version__ = version ? _fbb.CreateString(version) : 0; auto sha512__ = sha512 ? _fbb.CreateString(sha512) : 0; auto description__ = description ? _fbb.CreateString(description) : 0; auto author__ = author ? _fbb.CreateString(author) : 0; auto meta_doi__ = meta_doi ? _fbb.CreateString(meta_doi) : 0; auto data_doi__ = data_doi ? _fbb.CreateString(data_doi) : 0; auto recorder__ = recorder ? _fbb.CreateString(recorder) : 0; auto license__ = license ? _fbb.CreateString(license) : 0; auto hw__ = hw ? _fbb.CreateString(hw) : 0; auto dataset__ = dataset ? _fbb.CreateString(dataset) : 0; auto extensions__ = extensions ? _fbb.CreateVector>(*extensions) : 0; auto collection__ = collection ? _fbb.CreateString(collection) : 0; return sigmf::core::CreateGlobal( _fbb, datatype__, sample_rate, version__, num_channels, sha512__, offset, description__, author__, meta_doi__, data_doi__, recorder__, license__, hw__, dataset__, trailing_bytes, metadata_only, geolocation, extensions__, collection__); } flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct CaptureT : public flatbuffers::NativeTable { typedef Capture TableType; flatbuffers::Optional sample_start = flatbuffers::nullopt; flatbuffers::Optional global_index = flatbuffers::nullopt; flatbuffers::Optional header_bytes = flatbuffers::nullopt; flatbuffers::Optional frequency = flatbuffers::nullopt; std::string datetime{}; }; struct Capture FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CaptureT NativeTableType; typedef CaptureBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return CaptureTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SAMPLE_START = 4, VT_GLOBAL_INDEX = 6, VT_HEADER_BYTES = 8, VT_FREQUENCY = 10, VT_DATETIME = 12 }; flatbuffers::Optional sample_start() const { return GetOptional(VT_SAMPLE_START); } flatbuffers::Optional global_index() const { return GetOptional(VT_GLOBAL_INDEX); } flatbuffers::Optional header_bytes() const { return GetOptional(VT_HEADER_BYTES); } flatbuffers::Optional frequency() const { return GetOptional(VT_FREQUENCY); } const flatbuffers::String *datetime() const { return GetPointer(VT_DATETIME); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_SAMPLE_START) && VerifyField(verifier, VT_GLOBAL_INDEX) && VerifyField(verifier, VT_HEADER_BYTES) && VerifyField(verifier, VT_FREQUENCY) && VerifyOffset(verifier, VT_DATETIME) && verifier.VerifyString(datetime()) && verifier.EndTable(); } CaptureT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct CaptureBuilder { typedef Capture Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_sample_start(uint64_t sample_start) { fbb_.AddElement(Capture::VT_SAMPLE_START, sample_start); } void add_global_index(uint64_t global_index) { fbb_.AddElement(Capture::VT_GLOBAL_INDEX, global_index); } void add_header_bytes(uint64_t header_bytes) { fbb_.AddElement(Capture::VT_HEADER_BYTES, header_bytes); } void add_frequency(double frequency) { fbb_.AddElement(Capture::VT_FREQUENCY, frequency); } void add_datetime(flatbuffers::Offset datetime) { fbb_.AddOffset(Capture::VT_DATETIME, datetime); } explicit CaptureBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateCapture( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional sample_start = flatbuffers::nullopt, flatbuffers::Optional global_index = flatbuffers::nullopt, flatbuffers::Optional header_bytes = flatbuffers::nullopt, flatbuffers::Optional frequency = flatbuffers::nullopt, flatbuffers::Offset datetime = 0) { CaptureBuilder builder_(_fbb); if(frequency) { builder_.add_frequency(*frequency); } if(header_bytes) { builder_.add_header_bytes(*header_bytes); } if(global_index) { builder_.add_global_index(*global_index); } if(sample_start) { builder_.add_sample_start(*sample_start); } builder_.add_datetime(datetime); return builder_.Finish(); } inline flatbuffers::Offset CreateCaptureDirect( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional sample_start = flatbuffers::nullopt, flatbuffers::Optional global_index = flatbuffers::nullopt, flatbuffers::Optional header_bytes = flatbuffers::nullopt, flatbuffers::Optional frequency = flatbuffers::nullopt, const char *datetime = nullptr) { auto datetime__ = datetime ? _fbb.CreateString(datetime) : 0; return sigmf::core::CreateCapture( _fbb, sample_start, global_index, header_bytes, frequency, datetime__); } flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct AnnotationT : public flatbuffers::NativeTable { typedef Annotation TableType; flatbuffers::Optional sample_start = flatbuffers::nullopt; flatbuffers::Optional sample_count = flatbuffers::nullopt; std::string generator{}; std::string description{}; std::string label{}; std::string comment{}; flatbuffers::Optional freq_lower_edge = flatbuffers::nullopt; flatbuffers::Optional freq_upper_edge = flatbuffers::nullopt; flatbuffers::Optional latitude = flatbuffers::nullopt; flatbuffers::Optional longitude = flatbuffers::nullopt; }; struct Annotation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef AnnotationT NativeTableType; typedef AnnotationBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return AnnotationTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SAMPLE_START = 4, VT_SAMPLE_COUNT = 6, VT_GENERATOR = 8, VT_DESCRIPTION = 10, VT_LABEL = 12, VT_COMMENT = 14, VT_FREQ_LOWER_EDGE = 16, VT_FREQ_UPPER_EDGE = 18, VT_LATITUDE = 20, VT_LONGITUDE = 22 }; flatbuffers::Optional sample_start() const { return GetOptional(VT_SAMPLE_START); } flatbuffers::Optional sample_count() const { return GetOptional(VT_SAMPLE_COUNT); } const flatbuffers::String *generator() const { return GetPointer(VT_GENERATOR); } const flatbuffers::String *description() const { return GetPointer(VT_DESCRIPTION); } const flatbuffers::String *label() const { return GetPointer(VT_LABEL); } const flatbuffers::String *comment() const { return GetPointer(VT_COMMENT); } flatbuffers::Optional freq_lower_edge() const { return GetOptional(VT_FREQ_LOWER_EDGE); } flatbuffers::Optional freq_upper_edge() const { return GetOptional(VT_FREQ_UPPER_EDGE); } flatbuffers::Optional latitude() const { return GetOptional(VT_LATITUDE); } flatbuffers::Optional longitude() const { return GetOptional(VT_LONGITUDE); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_SAMPLE_START) && VerifyField(verifier, VT_SAMPLE_COUNT) && VerifyOffset(verifier, VT_GENERATOR) && verifier.VerifyString(generator()) && VerifyOffset(verifier, VT_DESCRIPTION) && verifier.VerifyString(description()) && VerifyOffset(verifier, VT_LABEL) && verifier.VerifyString(label()) && VerifyOffset(verifier, VT_COMMENT) && verifier.VerifyString(comment()) && VerifyField(verifier, VT_FREQ_LOWER_EDGE) && VerifyField(verifier, VT_FREQ_UPPER_EDGE) && VerifyField(verifier, VT_LATITUDE) && VerifyField(verifier, VT_LONGITUDE) && verifier.EndTable(); } AnnotationT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct AnnotationBuilder { typedef Annotation Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_sample_start(uint64_t sample_start) { fbb_.AddElement(Annotation::VT_SAMPLE_START, sample_start); } void add_sample_count(uint64_t sample_count) { fbb_.AddElement(Annotation::VT_SAMPLE_COUNT, sample_count); } void add_generator(flatbuffers::Offset generator) { fbb_.AddOffset(Annotation::VT_GENERATOR, generator); } void add_description(flatbuffers::Offset description) { fbb_.AddOffset(Annotation::VT_DESCRIPTION, description); } void add_label(flatbuffers::Offset label) { fbb_.AddOffset(Annotation::VT_LABEL, label); } void add_comment(flatbuffers::Offset comment) { fbb_.AddOffset(Annotation::VT_COMMENT, comment); } void add_freq_lower_edge(double freq_lower_edge) { fbb_.AddElement(Annotation::VT_FREQ_LOWER_EDGE, freq_lower_edge); } void add_freq_upper_edge(double freq_upper_edge) { fbb_.AddElement(Annotation::VT_FREQ_UPPER_EDGE, freq_upper_edge); } void add_latitude(double latitude) { fbb_.AddElement(Annotation::VT_LATITUDE, latitude); } void add_longitude(double longitude) { fbb_.AddElement(Annotation::VT_LONGITUDE, longitude); } explicit AnnotationBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateAnnotation( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional sample_start = flatbuffers::nullopt, flatbuffers::Optional sample_count = flatbuffers::nullopt, flatbuffers::Offset generator = 0, flatbuffers::Offset description = 0, flatbuffers::Offset label = 0, flatbuffers::Offset comment = 0, flatbuffers::Optional freq_lower_edge = flatbuffers::nullopt, flatbuffers::Optional freq_upper_edge = flatbuffers::nullopt, flatbuffers::Optional latitude = flatbuffers::nullopt, flatbuffers::Optional longitude = flatbuffers::nullopt) { AnnotationBuilder builder_(_fbb); if(longitude) { builder_.add_longitude(*longitude); } if(latitude) { builder_.add_latitude(*latitude); } if(freq_upper_edge) { builder_.add_freq_upper_edge(*freq_upper_edge); } if(freq_lower_edge) { builder_.add_freq_lower_edge(*freq_lower_edge); } if(sample_count) { builder_.add_sample_count(*sample_count); } if(sample_start) { builder_.add_sample_start(*sample_start); } builder_.add_comment(comment); builder_.add_label(label); builder_.add_description(description); builder_.add_generator(generator); return builder_.Finish(); } inline flatbuffers::Offset CreateAnnotationDirect( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional sample_start = flatbuffers::nullopt, flatbuffers::Optional sample_count = flatbuffers::nullopt, const char *generator = nullptr, const char *description = nullptr, const char *label = nullptr, const char *comment = nullptr, flatbuffers::Optional freq_lower_edge = flatbuffers::nullopt, flatbuffers::Optional freq_upper_edge = flatbuffers::nullopt, flatbuffers::Optional latitude = flatbuffers::nullopt, flatbuffers::Optional longitude = flatbuffers::nullopt) { auto generator__ = generator ? _fbb.CreateString(generator) : 0; auto description__ = description ? _fbb.CreateString(description) : 0; auto label__ = label ? _fbb.CreateString(label) : 0; auto comment__ = comment ? _fbb.CreateString(comment) : 0; return sigmf::core::CreateAnnotation( _fbb, sample_start, sample_count, generator__, description__, label__, comment__, freq_lower_edge, freq_upper_edge, latitude, longitude); } flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct CollectionT : public flatbuffers::NativeTable { typedef Collection TableType; std::string version{}; std::string description{}; std::string author{}; std::string collection_doi{}; std::string license{}; std::vector> extensions{}; std::vector> streams{}; }; struct Collection FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CollectionT NativeTableType; typedef CollectionBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return CollectionTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_VERSION = 4, VT_DESCRIPTION = 6, VT_AUTHOR = 8, VT_COLLECTION_DOI = 10, VT_LICENSE = 12, VT_EXTENSIONS = 14, VT_STREAMS = 16 }; const flatbuffers::String *version() const { return GetPointer(VT_VERSION); } const flatbuffers::String *description() const { return GetPointer(VT_DESCRIPTION); } const flatbuffers::String *author() const { return GetPointer(VT_AUTHOR); } const flatbuffers::String *collection_doi() const { return GetPointer(VT_COLLECTION_DOI); } const flatbuffers::String *license() const { return GetPointer(VT_LICENSE); } const flatbuffers::Vector> *extensions() const { return GetPointer> *>(VT_EXTENSIONS); } const flatbuffers::Vector> *streams() const { return GetPointer> *>(VT_STREAMS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_VERSION) && verifier.VerifyString(version()) && VerifyOffset(verifier, VT_DESCRIPTION) && verifier.VerifyString(description()) && VerifyOffset(verifier, VT_AUTHOR) && verifier.VerifyString(author()) && VerifyOffset(verifier, VT_COLLECTION_DOI) && verifier.VerifyString(collection_doi()) && VerifyOffset(verifier, VT_LICENSE) && verifier.VerifyString(license()) && VerifyOffset(verifier, VT_EXTENSIONS) && verifier.VerifyVector(extensions()) && verifier.VerifyVectorOfTables(extensions()) && VerifyOffset(verifier, VT_STREAMS) && verifier.VerifyVector(streams()) && verifier.VerifyVectorOfTables(streams()) && verifier.EndTable(); } CollectionT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(CollectionT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct CollectionBuilder { typedef Collection Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_version(flatbuffers::Offset version) { fbb_.AddOffset(Collection::VT_VERSION, version); } void add_description(flatbuffers::Offset description) { fbb_.AddOffset(Collection::VT_DESCRIPTION, description); } void add_author(flatbuffers::Offset author) { fbb_.AddOffset(Collection::VT_AUTHOR, author); } void add_collection_doi(flatbuffers::Offset collection_doi) { fbb_.AddOffset(Collection::VT_COLLECTION_DOI, collection_doi); } void add_license(flatbuffers::Offset license) { fbb_.AddOffset(Collection::VT_LICENSE, license); } void add_extensions(flatbuffers::Offset>> extensions) { fbb_.AddOffset(Collection::VT_EXTENSIONS, extensions); } void add_streams(flatbuffers::Offset>> streams) { fbb_.AddOffset(Collection::VT_STREAMS, streams); } explicit CollectionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateCollection( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset version = 0, flatbuffers::Offset description = 0, flatbuffers::Offset author = 0, flatbuffers::Offset collection_doi = 0, flatbuffers::Offset license = 0, flatbuffers::Offset>> extensions = 0, flatbuffers::Offset>> streams = 0) { CollectionBuilder builder_(_fbb); builder_.add_streams(streams); builder_.add_extensions(extensions); builder_.add_license(license); builder_.add_collection_doi(collection_doi); builder_.add_author(author); builder_.add_description(description); builder_.add_version(version); return builder_.Finish(); } inline flatbuffers::Offset CreateCollectionDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *version = nullptr, const char *description = nullptr, const char *author = nullptr, const char *collection_doi = nullptr, const char *license = nullptr, const std::vector> *extensions = nullptr, const std::vector> *streams = nullptr) { auto version__ = version ? _fbb.CreateString(version) : 0; auto description__ = description ? _fbb.CreateString(description) : 0; auto author__ = author ? _fbb.CreateString(author) : 0; auto collection_doi__ = collection_doi ? _fbb.CreateString(collection_doi) : 0; auto license__ = license ? _fbb.CreateString(license) : 0; auto extensions__ = extensions ? _fbb.CreateVector>(*extensions) : 0; auto streams__ = streams ? _fbb.CreateVector>(*streams) : 0; return sigmf::core::CreateCollection( _fbb, version__, description__, author__, collection_doi__, license__, extensions__, streams__); } flatbuffers::Offset CreateCollection(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct DescrT : public flatbuffers::NativeTable { typedef Descr TableType; std::shared_ptr global{}; std::shared_ptr annotation{}; std::shared_ptr capture{}; std::shared_ptr collection{}; }; struct Descr FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DescrT NativeTableType; typedef DescrBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return DescrTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_GLOBAL = 4, VT_ANNOTATION = 6, VT_CAPTURE = 8, VT_COLLECTION = 10 }; const sigmf::core::Global *global() const { return GetPointer(VT_GLOBAL); } const sigmf::core::Annotation *annotation() const { return GetPointer(VT_ANNOTATION); } const sigmf::core::Capture *capture() const { return GetPointer(VT_CAPTURE); } const sigmf::core::Collection *collection() const { return GetPointer(VT_COLLECTION); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_GLOBAL) && verifier.VerifyTable(global()) && VerifyOffset(verifier, VT_ANNOTATION) && verifier.VerifyTable(annotation()) && VerifyOffset(verifier, VT_CAPTURE) && verifier.VerifyTable(capture()) && VerifyOffset(verifier, VT_COLLECTION) && verifier.VerifyTable(collection()) && verifier.EndTable(); } DescrT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DescrBuilder { typedef Descr Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_global(flatbuffers::Offset global) { fbb_.AddOffset(Descr::VT_GLOBAL, global); } void add_annotation(flatbuffers::Offset annotation) { fbb_.AddOffset(Descr::VT_ANNOTATION, annotation); } void add_capture(flatbuffers::Offset capture) { fbb_.AddOffset(Descr::VT_CAPTURE, capture); } void add_collection(flatbuffers::Offset collection) { fbb_.AddOffset(Descr::VT_COLLECTION, collection); } explicit DescrBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateDescr( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset global = 0, flatbuffers::Offset annotation = 0, flatbuffers::Offset capture = 0, flatbuffers::Offset collection = 0) { DescrBuilder builder_(_fbb); builder_.add_collection(collection); builder_.add_capture(capture); builder_.add_annotation(annotation); builder_.add_global(global); return builder_.Finish(); } flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); inline sigmf_extensionT *sigmf_extension::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new sigmf_extensionT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void sigmf_extension::UnPackTo(sigmf_extensionT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = name(); if (_e) _o->name = _e->str(); } { auto _e = version(); if (_e) _o->version = _e->str(); } { auto _e = optional(); _o->optional = _e; } } inline flatbuffers::Offset sigmf_extension::Pack(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_extensionT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createsigmf_extension(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createsigmf_extension(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_extensionT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const sigmf_extensionT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _name = _o->name.empty() ? 0 : _fbb.CreateString(_o->name); auto _version = _o->version.empty() ? 0 : _fbb.CreateString(_o->version); auto _optional = _o->optional; return sigmf::core::Createsigmf_extension( _fbb, _name, _version, _optional); } inline sigmf_streamT *sigmf_stream::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new sigmf_streamT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void sigmf_stream::UnPackTo(sigmf_streamT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = name(); if (_e) _o->name = _e->str(); } { auto _e = hash(); if (_e) _o->hash = _e->str(); } } inline flatbuffers::Offset sigmf_stream::Pack(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_streamT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createsigmf_stream(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createsigmf_stream(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_streamT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const sigmf_streamT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _name = _o->name.empty() ? 0 : _fbb.CreateString(_o->name); auto _hash = _o->hash.empty() ? 0 : _fbb.CreateString(_o->hash); return sigmf::core::Createsigmf_stream( _fbb, _name, _hash); } inline geojson_pointT *geojson_point::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new geojson_pointT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void geojson_point::UnPackTo(geojson_pointT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = type(); if (_e) _o->type = _e->str(); } { auto _e = coordinates(); if (_e) { _o->coordinates.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->coordinates[_i] = _e->Get(_i); } } } } inline flatbuffers::Offset geojson_point::Pack(flatbuffers::FlatBufferBuilder &_fbb, const geojson_pointT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Creategeojson_point(_fbb, _o, _rehasher); } inline flatbuffers::Offset Creategeojson_point(flatbuffers::FlatBufferBuilder &_fbb, const geojson_pointT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const geojson_pointT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _type = _o->type.empty() ? 0 : _fbb.CreateString(_o->type); auto _coordinates = _o->coordinates.size() ? _fbb.CreateVector(_o->coordinates) : 0; return sigmf::core::Creategeojson_point( _fbb, _type, _coordinates); } inline GlobalT *Global::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new GlobalT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Global::UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = datatype(); if (_e) _o->datatype = _e->str(); } { auto _e = sample_rate(); _o->sample_rate = _e; } { auto _e = version(); if (_e) _o->version = _e->str(); } { auto _e = num_channels(); _o->num_channels = _e; } { auto _e = sha512(); if (_e) _o->sha512 = _e->str(); } { auto _e = offset(); _o->offset = _e; } { auto _e = description(); if (_e) _o->description = _e->str(); } { auto _e = author(); if (_e) _o->author = _e->str(); } { auto _e = meta_doi(); if (_e) _o->meta_doi = _e->str(); } { auto _e = data_doi(); if (_e) _o->data_doi = _e->str(); } { auto _e = recorder(); if (_e) _o->recorder = _e->str(); } { auto _e = license(); if (_e) _o->license = _e->str(); } { auto _e = hw(); if (_e) _o->hw = _e->str(); } { auto _e = dataset(); if (_e) _o->dataset = _e->str(); } { auto _e = trailing_bytes(); _o->trailing_bytes = _e; } { auto _e = metadata_only(); _o->metadata_only = _e; } { auto _e = geolocation(); if (_e) _o->geolocation = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = extensions(); if (_e) { _o->extensions.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->extensions[_i] = std::shared_ptr(_e->Get(_i)->UnPack(_resolver)); } } } { auto _e = collection(); if (_e) _o->collection = _e->str(); } } inline flatbuffers::Offset Global::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateGlobal(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GlobalT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _datatype = _o->datatype.empty() ? 0 : _fbb.CreateString(_o->datatype); auto _sample_rate = _o->sample_rate; auto _version = _o->version.empty() ? 0 : _fbb.CreateString(_o->version); auto _num_channels = _o->num_channels; auto _sha512 = _o->sha512.empty() ? 0 : _fbb.CreateString(_o->sha512); auto _offset = _o->offset; auto _description = _o->description.empty() ? 0 : _fbb.CreateString(_o->description); auto _author = _o->author.empty() ? 0 : _fbb.CreateString(_o->author); auto _meta_doi = _o->meta_doi.empty() ? 0 : _fbb.CreateString(_o->meta_doi); auto _data_doi = _o->data_doi.empty() ? 0 : _fbb.CreateString(_o->data_doi); auto _recorder = _o->recorder.empty() ? 0 : _fbb.CreateString(_o->recorder); auto _license = _o->license.empty() ? 0 : _fbb.CreateString(_o->license); auto _hw = _o->hw.empty() ? 0 : _fbb.CreateString(_o->hw); auto _dataset = _o->dataset.empty() ? 0 : _fbb.CreateString(_o->dataset); auto _trailing_bytes = _o->trailing_bytes; auto _metadata_only = _o->metadata_only; auto _geolocation = _o->geolocation ? Creategeojson_point(_fbb, _o->geolocation.get(), _rehasher) : 0; auto _extensions = _o->extensions.size() ? _fbb.CreateVector> (_o->extensions.size(), [](size_t i, _VectorArgs *__va) { return Createsigmf_extension(*__va->__fbb, __va->__o->extensions[i].get(), __va->__rehasher); }, &_va ) : 0; auto _collection = _o->collection.empty() ? 0 : _fbb.CreateString(_o->collection); return sigmf::core::CreateGlobal( _fbb, _datatype, _sample_rate, _version, _num_channels, _sha512, _offset, _description, _author, _meta_doi, _data_doi, _recorder, _license, _hw, _dataset, _trailing_bytes, _metadata_only, _geolocation, _extensions, _collection); } inline CaptureT *Capture::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new CaptureT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Capture::UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = sample_start(); _o->sample_start = _e; } { auto _e = global_index(); _o->global_index = _e; } { auto _e = header_bytes(); _o->header_bytes = _e; } { auto _e = frequency(); _o->frequency = _e; } { auto _e = datetime(); if (_e) _o->datetime = _e->str(); } } inline flatbuffers::Offset Capture::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateCapture(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CaptureT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _sample_start = _o->sample_start; auto _global_index = _o->global_index; auto _header_bytes = _o->header_bytes; auto _frequency = _o->frequency; auto _datetime = _o->datetime.empty() ? 0 : _fbb.CreateString(_o->datetime); return sigmf::core::CreateCapture( _fbb, _sample_start, _global_index, _header_bytes, _frequency, _datetime); } inline AnnotationT *Annotation::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new AnnotationT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Annotation::UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = sample_start(); _o->sample_start = _e; } { auto _e = sample_count(); _o->sample_count = _e; } { auto _e = generator(); if (_e) _o->generator = _e->str(); } { auto _e = description(); if (_e) _o->description = _e->str(); } { auto _e = label(); if (_e) _o->label = _e->str(); } { auto _e = comment(); if (_e) _o->comment = _e->str(); } { auto _e = freq_lower_edge(); _o->freq_lower_edge = _e; } { auto _e = freq_upper_edge(); _o->freq_upper_edge = _e; } { auto _e = latitude(); _o->latitude = _e; } { auto _e = longitude(); _o->longitude = _e; } } inline flatbuffers::Offset Annotation::Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateAnnotation(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const AnnotationT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _sample_start = _o->sample_start; auto _sample_count = _o->sample_count; auto _generator = _o->generator.empty() ? 0 : _fbb.CreateString(_o->generator); auto _description = _o->description.empty() ? 0 : _fbb.CreateString(_o->description); auto _label = _o->label.empty() ? 0 : _fbb.CreateString(_o->label); auto _comment = _o->comment.empty() ? 0 : _fbb.CreateString(_o->comment); auto _freq_lower_edge = _o->freq_lower_edge; auto _freq_upper_edge = _o->freq_upper_edge; auto _latitude = _o->latitude; auto _longitude = _o->longitude; return sigmf::core::CreateAnnotation( _fbb, _sample_start, _sample_count, _generator, _description, _label, _comment, _freq_lower_edge, _freq_upper_edge, _latitude, _longitude); } inline CollectionT *Collection::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new CollectionT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Collection::UnPackTo(CollectionT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = version(); if (_e) _o->version = _e->str(); } { auto _e = description(); if (_e) _o->description = _e->str(); } { auto _e = author(); if (_e) _o->author = _e->str(); } { auto _e = collection_doi(); if (_e) _o->collection_doi = _e->str(); } { auto _e = license(); if (_e) _o->license = _e->str(); } { auto _e = extensions(); if (_e) { _o->extensions.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->extensions[_i] = std::shared_ptr(_e->Get(_i)->UnPack(_resolver)); } } } { auto _e = streams(); if (_e) { _o->streams.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->streams[_i] = std::shared_ptr(_e->Get(_i)->UnPack(_resolver)); } } } } inline flatbuffers::Offset Collection::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateCollection(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateCollection(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CollectionT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _version = _o->version.empty() ? 0 : _fbb.CreateString(_o->version); auto _description = _o->description.empty() ? 0 : _fbb.CreateString(_o->description); auto _author = _o->author.empty() ? 0 : _fbb.CreateString(_o->author); auto _collection_doi = _o->collection_doi.empty() ? 0 : _fbb.CreateString(_o->collection_doi); auto _license = _o->license.empty() ? 0 : _fbb.CreateString(_o->license); auto _extensions = _o->extensions.size() ? _fbb.CreateVector> (_o->extensions.size(), [](size_t i, _VectorArgs *__va) { return Createsigmf_extension(*__va->__fbb, __va->__o->extensions[i].get(), __va->__rehasher); }, &_va ) : 0; auto _streams = _o->streams.size() ? _fbb.CreateVector> (_o->streams.size(), [](size_t i, _VectorArgs *__va) { return Createsigmf_stream(*__va->__fbb, __va->__o->streams[i].get(), __va->__rehasher); }, &_va ) : 0; return sigmf::core::CreateCollection( _fbb, _version, _description, _author, _collection_doi, _license, _extensions, _streams); } inline DescrT *Descr::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new DescrT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Descr::UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = global(); if (_e) _o->global = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = annotation(); if (_e) _o->annotation = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = capture(); if (_e) _o->capture = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = collection(); if (_e) _o->collection = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset Descr::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateDescr(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DescrT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _global = _o->global ? CreateGlobal(_fbb, _o->global.get(), _rehasher) : 0; auto _annotation = _o->annotation ? CreateAnnotation(_fbb, _o->annotation.get(), _rehasher) : 0; auto _capture = _o->capture ? CreateCapture(_fbb, _o->capture.get(), _rehasher) : 0; auto _collection = _o->collection ? CreateCollection(_fbb, _o->collection.get(), _rehasher) : 0; return sigmf::core::CreateDescr( _fbb, _global, _annotation, _capture, _collection); } inline const flatbuffers::TypeTable *sigmf_extensionTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_BOOL, 0, -1 } }; static const char * const names[] = { "name", "version", "optional" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 3, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *sigmf_streamTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 } }; static const char * const names[] = { "name", "hash" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 2, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *geojson_pointTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_DOUBLE, 1, -1 } }; static const char * const names[] = { "type", "coordinates" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 2, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *GlobalTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_BOOL, 0, -1 }, { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 1, 1 }, { flatbuffers::ET_STRING, 0, -1 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::core::geojson_pointTypeTable, sigmf::core::sigmf_extensionTypeTable }; static const char * const names[] = { "datatype", "sample_rate", "version", "num_channels", "sha512", "offset", "description", "author", "meta_doi", "data_doi", "recorder", "license", "hw", "dataset", "trailing_bytes", "metadata_only", "geolocation", "extensions", "collection" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 19, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *CaptureTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 } }; static const char * const names[] = { "sample_start", "global_index", "header_bytes", "frequency", "datetime" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 5, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *AnnotationTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 } }; static const char * const names[] = { "sample_start", "sample_count", "generator", "description", "label", "comment", "freq_lower_edge", "freq_upper_edge", "latitude", "longitude" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 10, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *CollectionTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_SEQUENCE, 1, 0 }, { flatbuffers::ET_SEQUENCE, 1, 1 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::core::sigmf_extensionTypeTable, sigmf::core::sigmf_streamTypeTable }; static const char * const names[] = { "version", "description", "author", "collection_doi", "license", "extensions", "streams" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 7, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *DescrTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 1 }, { flatbuffers::ET_SEQUENCE, 0, 2 }, { flatbuffers::ET_SEQUENCE, 0, 3 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::core::GlobalTypeTable, sigmf::core::AnnotationTypeTable, sigmf::core::CaptureTypeTable, sigmf::core::CollectionTypeTable }; static const char * const names[] = { "global", "annotation", "capture", "collection" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 4, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } } // namespace core } // namespace sigmf #endif // FLATBUFFERS_GENERATED_SIGMFCORE_SIGMF_CORE_H_ libsigmf-1.0.2/sigmf_protocols/sigmf_signal.fbs000066400000000000000000000022511434644465300216720ustar00rootroot00000000000000 include "sigmf_core.fbs"; namespace sigmf.signal; table Global { /*`signal` does not extend `global`*/ } table Capture { /*`signal` does not extend `captures`*/ } table signal_detail { // permitted string values: type:string; // analog, digital mod_class:string; // am, fm, pm, ssb, dsb, vsb, ask, fsk, psk, qam, ook, cpm, msk standard:string; carrier_variant:string; // with_carrier, suppressed_carrier, reduced_carrier, single_carrier, multi_carrier symbol_variant:string; // differential, offset order:ulong=null; duplexing:string; // tdd, fdd multiplexing:string; // tdm, fdm, cdm, ofdm, sdm, pdm multiple_access:string; // fdma, ofdma, tdma, cdma, sdma, pdma spreading:string; // fhss, thss, dsss, css channel_bw:double=null; channel:ulong=null; class_variant:string; } table signal_emitter { seid:ulong=null; manufacturer:string; power_tx:double=null; power_eirp:double=null; geolocation:core.geojson_point; } table Annotation { detail:signal_detail; emitter:signal_emitter; } table Descr { global:Global; annotation:Annotation; capture:Capture; } libsigmf-1.0.2/sigmf_protocols/sigmf_signal_generated.h000066400000000000000000001131711434644465300233710ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_SIGMFSIGNAL_SIGMF_SIGNAL_H_ #define FLATBUFFERS_GENERATED_SIGMFSIGNAL_SIGMF_SIGNAL_H_ #include "flatbuffers/flatbuffers.h" #include "sigmf_core_generated.h" namespace sigmf { namespace signal { struct Global; struct GlobalBuilder; struct GlobalT; struct Capture; struct CaptureBuilder; struct CaptureT; struct signal_detail; struct signal_detailBuilder; struct signal_detailT; struct signal_emitter; struct signal_emitterBuilder; struct signal_emitterT; struct Annotation; struct AnnotationBuilder; struct AnnotationT; struct Descr; struct DescrBuilder; struct DescrT; inline const flatbuffers::TypeTable *GlobalTypeTable(); inline const flatbuffers::TypeTable *CaptureTypeTable(); inline const flatbuffers::TypeTable *signal_detailTypeTable(); inline const flatbuffers::TypeTable *signal_emitterTypeTable(); inline const flatbuffers::TypeTable *AnnotationTypeTable(); inline const flatbuffers::TypeTable *DescrTypeTable(); struct GlobalT : public flatbuffers::NativeTable { typedef Global TableType; }; struct Global FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef GlobalT NativeTableType; typedef GlobalBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return GlobalTypeTable(); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } GlobalT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct GlobalBuilder { typedef Global Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; explicit GlobalBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateGlobal( flatbuffers::FlatBufferBuilder &_fbb) { GlobalBuilder builder_(_fbb); return builder_.Finish(); } flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct CaptureT : public flatbuffers::NativeTable { typedef Capture TableType; }; struct Capture FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CaptureT NativeTableType; typedef CaptureBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return CaptureTypeTable(); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } CaptureT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct CaptureBuilder { typedef Capture Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; explicit CaptureBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateCapture( flatbuffers::FlatBufferBuilder &_fbb) { CaptureBuilder builder_(_fbb); return builder_.Finish(); } flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct signal_detailT : public flatbuffers::NativeTable { typedef signal_detail TableType; std::string type{}; std::string mod_class{}; std::string standard{}; std::string carrier_variant{}; std::string symbol_variant{}; flatbuffers::Optional order = flatbuffers::nullopt; std::string duplexing{}; std::string multiplexing{}; std::string multiple_access{}; std::string spreading{}; flatbuffers::Optional channel_bw = flatbuffers::nullopt; flatbuffers::Optional channel = flatbuffers::nullopt; std::string class_variant{}; }; struct signal_detail FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef signal_detailT NativeTableType; typedef signal_detailBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return signal_detailTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_TYPE = 4, VT_MOD_CLASS = 6, VT_STANDARD = 8, VT_CARRIER_VARIANT = 10, VT_SYMBOL_VARIANT = 12, VT_ORDER = 14, VT_DUPLEXING = 16, VT_MULTIPLEXING = 18, VT_MULTIPLE_ACCESS = 20, VT_SPREADING = 22, VT_CHANNEL_BW = 24, VT_CHANNEL = 26, VT_CLASS_VARIANT = 28 }; const flatbuffers::String *type() const { return GetPointer(VT_TYPE); } const flatbuffers::String *mod_class() const { return GetPointer(VT_MOD_CLASS); } const flatbuffers::String *standard() const { return GetPointer(VT_STANDARD); } const flatbuffers::String *carrier_variant() const { return GetPointer(VT_CARRIER_VARIANT); } const flatbuffers::String *symbol_variant() const { return GetPointer(VT_SYMBOL_VARIANT); } flatbuffers::Optional order() const { return GetOptional(VT_ORDER); } const flatbuffers::String *duplexing() const { return GetPointer(VT_DUPLEXING); } const flatbuffers::String *multiplexing() const { return GetPointer(VT_MULTIPLEXING); } const flatbuffers::String *multiple_access() const { return GetPointer(VT_MULTIPLE_ACCESS); } const flatbuffers::String *spreading() const { return GetPointer(VT_SPREADING); } flatbuffers::Optional channel_bw() const { return GetOptional(VT_CHANNEL_BW); } flatbuffers::Optional channel() const { return GetOptional(VT_CHANNEL); } const flatbuffers::String *class_variant() const { return GetPointer(VT_CLASS_VARIANT); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_TYPE) && verifier.VerifyString(type()) && VerifyOffset(verifier, VT_MOD_CLASS) && verifier.VerifyString(mod_class()) && VerifyOffset(verifier, VT_STANDARD) && verifier.VerifyString(standard()) && VerifyOffset(verifier, VT_CARRIER_VARIANT) && verifier.VerifyString(carrier_variant()) && VerifyOffset(verifier, VT_SYMBOL_VARIANT) && verifier.VerifyString(symbol_variant()) && VerifyField(verifier, VT_ORDER) && VerifyOffset(verifier, VT_DUPLEXING) && verifier.VerifyString(duplexing()) && VerifyOffset(verifier, VT_MULTIPLEXING) && verifier.VerifyString(multiplexing()) && VerifyOffset(verifier, VT_MULTIPLE_ACCESS) && verifier.VerifyString(multiple_access()) && VerifyOffset(verifier, VT_SPREADING) && verifier.VerifyString(spreading()) && VerifyField(verifier, VT_CHANNEL_BW) && VerifyField(verifier, VT_CHANNEL) && VerifyOffset(verifier, VT_CLASS_VARIANT) && verifier.VerifyString(class_variant()) && verifier.EndTable(); } signal_detailT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(signal_detailT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const signal_detailT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct signal_detailBuilder { typedef signal_detail Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_type(flatbuffers::Offset type) { fbb_.AddOffset(signal_detail::VT_TYPE, type); } void add_mod_class(flatbuffers::Offset mod_class) { fbb_.AddOffset(signal_detail::VT_MOD_CLASS, mod_class); } void add_standard(flatbuffers::Offset standard) { fbb_.AddOffset(signal_detail::VT_STANDARD, standard); } void add_carrier_variant(flatbuffers::Offset carrier_variant) { fbb_.AddOffset(signal_detail::VT_CARRIER_VARIANT, carrier_variant); } void add_symbol_variant(flatbuffers::Offset symbol_variant) { fbb_.AddOffset(signal_detail::VT_SYMBOL_VARIANT, symbol_variant); } void add_order(uint64_t order) { fbb_.AddElement(signal_detail::VT_ORDER, order); } void add_duplexing(flatbuffers::Offset duplexing) { fbb_.AddOffset(signal_detail::VT_DUPLEXING, duplexing); } void add_multiplexing(flatbuffers::Offset multiplexing) { fbb_.AddOffset(signal_detail::VT_MULTIPLEXING, multiplexing); } void add_multiple_access(flatbuffers::Offset multiple_access) { fbb_.AddOffset(signal_detail::VT_MULTIPLE_ACCESS, multiple_access); } void add_spreading(flatbuffers::Offset spreading) { fbb_.AddOffset(signal_detail::VT_SPREADING, spreading); } void add_channel_bw(double channel_bw) { fbb_.AddElement(signal_detail::VT_CHANNEL_BW, channel_bw); } void add_channel(uint64_t channel) { fbb_.AddElement(signal_detail::VT_CHANNEL, channel); } void add_class_variant(flatbuffers::Offset class_variant) { fbb_.AddOffset(signal_detail::VT_CLASS_VARIANT, class_variant); } explicit signal_detailBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createsignal_detail( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset type = 0, flatbuffers::Offset mod_class = 0, flatbuffers::Offset standard = 0, flatbuffers::Offset carrier_variant = 0, flatbuffers::Offset symbol_variant = 0, flatbuffers::Optional order = flatbuffers::nullopt, flatbuffers::Offset duplexing = 0, flatbuffers::Offset multiplexing = 0, flatbuffers::Offset multiple_access = 0, flatbuffers::Offset spreading = 0, flatbuffers::Optional channel_bw = flatbuffers::nullopt, flatbuffers::Optional channel = flatbuffers::nullopt, flatbuffers::Offset class_variant = 0) { signal_detailBuilder builder_(_fbb); if(channel) { builder_.add_channel(*channel); } if(channel_bw) { builder_.add_channel_bw(*channel_bw); } if(order) { builder_.add_order(*order); } builder_.add_class_variant(class_variant); builder_.add_spreading(spreading); builder_.add_multiple_access(multiple_access); builder_.add_multiplexing(multiplexing); builder_.add_duplexing(duplexing); builder_.add_symbol_variant(symbol_variant); builder_.add_carrier_variant(carrier_variant); builder_.add_standard(standard); builder_.add_mod_class(mod_class); builder_.add_type(type); return builder_.Finish(); } inline flatbuffers::Offset Createsignal_detailDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *type = nullptr, const char *mod_class = nullptr, const char *standard = nullptr, const char *carrier_variant = nullptr, const char *symbol_variant = nullptr, flatbuffers::Optional order = flatbuffers::nullopt, const char *duplexing = nullptr, const char *multiplexing = nullptr, const char *multiple_access = nullptr, const char *spreading = nullptr, flatbuffers::Optional channel_bw = flatbuffers::nullopt, flatbuffers::Optional channel = flatbuffers::nullopt, const char *class_variant = nullptr) { auto type__ = type ? _fbb.CreateString(type) : 0; auto mod_class__ = mod_class ? _fbb.CreateString(mod_class) : 0; auto standard__ = standard ? _fbb.CreateString(standard) : 0; auto carrier_variant__ = carrier_variant ? _fbb.CreateString(carrier_variant) : 0; auto symbol_variant__ = symbol_variant ? _fbb.CreateString(symbol_variant) : 0; auto duplexing__ = duplexing ? _fbb.CreateString(duplexing) : 0; auto multiplexing__ = multiplexing ? _fbb.CreateString(multiplexing) : 0; auto multiple_access__ = multiple_access ? _fbb.CreateString(multiple_access) : 0; auto spreading__ = spreading ? _fbb.CreateString(spreading) : 0; auto class_variant__ = class_variant ? _fbb.CreateString(class_variant) : 0; return sigmf::signal::Createsignal_detail( _fbb, type__, mod_class__, standard__, carrier_variant__, symbol_variant__, order, duplexing__, multiplexing__, multiple_access__, spreading__, channel_bw, channel, class_variant__); } flatbuffers::Offset Createsignal_detail(flatbuffers::FlatBufferBuilder &_fbb, const signal_detailT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct signal_emitterT : public flatbuffers::NativeTable { typedef signal_emitter TableType; flatbuffers::Optional seid = flatbuffers::nullopt; std::string manufacturer{}; flatbuffers::Optional power_tx = flatbuffers::nullopt; flatbuffers::Optional power_eirp = flatbuffers::nullopt; std::shared_ptr geolocation{}; }; struct signal_emitter FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef signal_emitterT NativeTableType; typedef signal_emitterBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return signal_emitterTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SEID = 4, VT_MANUFACTURER = 6, VT_POWER_TX = 8, VT_POWER_EIRP = 10, VT_GEOLOCATION = 12 }; flatbuffers::Optional seid() const { return GetOptional(VT_SEID); } const flatbuffers::String *manufacturer() const { return GetPointer(VT_MANUFACTURER); } flatbuffers::Optional power_tx() const { return GetOptional(VT_POWER_TX); } flatbuffers::Optional power_eirp() const { return GetOptional(VT_POWER_EIRP); } const sigmf::core::geojson_point *geolocation() const { return GetPointer(VT_GEOLOCATION); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_SEID) && VerifyOffset(verifier, VT_MANUFACTURER) && verifier.VerifyString(manufacturer()) && VerifyField(verifier, VT_POWER_TX) && VerifyField(verifier, VT_POWER_EIRP) && VerifyOffset(verifier, VT_GEOLOCATION) && verifier.VerifyTable(geolocation()) && verifier.EndTable(); } signal_emitterT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(signal_emitterT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const signal_emitterT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct signal_emitterBuilder { typedef signal_emitter Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_seid(uint64_t seid) { fbb_.AddElement(signal_emitter::VT_SEID, seid); } void add_manufacturer(flatbuffers::Offset manufacturer) { fbb_.AddOffset(signal_emitter::VT_MANUFACTURER, manufacturer); } void add_power_tx(double power_tx) { fbb_.AddElement(signal_emitter::VT_POWER_TX, power_tx); } void add_power_eirp(double power_eirp) { fbb_.AddElement(signal_emitter::VT_POWER_EIRP, power_eirp); } void add_geolocation(flatbuffers::Offset geolocation) { fbb_.AddOffset(signal_emitter::VT_GEOLOCATION, geolocation); } explicit signal_emitterBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createsignal_emitter( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional seid = flatbuffers::nullopt, flatbuffers::Offset manufacturer = 0, flatbuffers::Optional power_tx = flatbuffers::nullopt, flatbuffers::Optional power_eirp = flatbuffers::nullopt, flatbuffers::Offset geolocation = 0) { signal_emitterBuilder builder_(_fbb); if(power_eirp) { builder_.add_power_eirp(*power_eirp); } if(power_tx) { builder_.add_power_tx(*power_tx); } if(seid) { builder_.add_seid(*seid); } builder_.add_geolocation(geolocation); builder_.add_manufacturer(manufacturer); return builder_.Finish(); } inline flatbuffers::Offset Createsignal_emitterDirect( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional seid = flatbuffers::nullopt, const char *manufacturer = nullptr, flatbuffers::Optional power_tx = flatbuffers::nullopt, flatbuffers::Optional power_eirp = flatbuffers::nullopt, flatbuffers::Offset geolocation = 0) { auto manufacturer__ = manufacturer ? _fbb.CreateString(manufacturer) : 0; return sigmf::signal::Createsignal_emitter( _fbb, seid, manufacturer__, power_tx, power_eirp, geolocation); } flatbuffers::Offset Createsignal_emitter(flatbuffers::FlatBufferBuilder &_fbb, const signal_emitterT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct AnnotationT : public flatbuffers::NativeTable { typedef Annotation TableType; std::shared_ptr detail{}; std::shared_ptr emitter{}; }; struct Annotation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef AnnotationT NativeTableType; typedef AnnotationBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return AnnotationTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_DETAIL = 4, VT_EMITTER = 6 }; const sigmf::signal::signal_detail *detail() const { return GetPointer(VT_DETAIL); } const sigmf::signal::signal_emitter *emitter() const { return GetPointer(VT_EMITTER); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_DETAIL) && verifier.VerifyTable(detail()) && VerifyOffset(verifier, VT_EMITTER) && verifier.VerifyTable(emitter()) && verifier.EndTable(); } AnnotationT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct AnnotationBuilder { typedef Annotation Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_detail(flatbuffers::Offset detail) { fbb_.AddOffset(Annotation::VT_DETAIL, detail); } void add_emitter(flatbuffers::Offset emitter) { fbb_.AddOffset(Annotation::VT_EMITTER, emitter); } explicit AnnotationBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateAnnotation( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset detail = 0, flatbuffers::Offset emitter = 0) { AnnotationBuilder builder_(_fbb); builder_.add_emitter(emitter); builder_.add_detail(detail); return builder_.Finish(); } flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct DescrT : public flatbuffers::NativeTable { typedef Descr TableType; std::shared_ptr global{}; std::shared_ptr annotation{}; std::shared_ptr capture{}; }; struct Descr FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DescrT NativeTableType; typedef DescrBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return DescrTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_GLOBAL = 4, VT_ANNOTATION = 6, VT_CAPTURE = 8 }; const sigmf::signal::Global *global() const { return GetPointer(VT_GLOBAL); } const sigmf::signal::Annotation *annotation() const { return GetPointer(VT_ANNOTATION); } const sigmf::signal::Capture *capture() const { return GetPointer(VT_CAPTURE); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_GLOBAL) && verifier.VerifyTable(global()) && VerifyOffset(verifier, VT_ANNOTATION) && verifier.VerifyTable(annotation()) && VerifyOffset(verifier, VT_CAPTURE) && verifier.VerifyTable(capture()) && verifier.EndTable(); } DescrT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DescrBuilder { typedef Descr Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_global(flatbuffers::Offset global) { fbb_.AddOffset(Descr::VT_GLOBAL, global); } void add_annotation(flatbuffers::Offset annotation) { fbb_.AddOffset(Descr::VT_ANNOTATION, annotation); } void add_capture(flatbuffers::Offset capture) { fbb_.AddOffset(Descr::VT_CAPTURE, capture); } explicit DescrBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateDescr( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset global = 0, flatbuffers::Offset annotation = 0, flatbuffers::Offset capture = 0) { DescrBuilder builder_(_fbb); builder_.add_capture(capture); builder_.add_annotation(annotation); builder_.add_global(global); return builder_.Finish(); } flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); inline GlobalT *Global::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new GlobalT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Global::UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; } inline flatbuffers::Offset Global::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateGlobal(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GlobalT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; return sigmf::signal::CreateGlobal( _fbb); } inline CaptureT *Capture::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new CaptureT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Capture::UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; } inline flatbuffers::Offset Capture::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateCapture(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CaptureT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; return sigmf::signal::CreateCapture( _fbb); } inline signal_detailT *signal_detail::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new signal_detailT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void signal_detail::UnPackTo(signal_detailT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = type(); if (_e) _o->type = _e->str(); } { auto _e = mod_class(); if (_e) _o->mod_class = _e->str(); } { auto _e = standard(); if (_e) _o->standard = _e->str(); } { auto _e = carrier_variant(); if (_e) _o->carrier_variant = _e->str(); } { auto _e = symbol_variant(); if (_e) _o->symbol_variant = _e->str(); } { auto _e = order(); _o->order = _e; } { auto _e = duplexing(); if (_e) _o->duplexing = _e->str(); } { auto _e = multiplexing(); if (_e) _o->multiplexing = _e->str(); } { auto _e = multiple_access(); if (_e) _o->multiple_access = _e->str(); } { auto _e = spreading(); if (_e) _o->spreading = _e->str(); } { auto _e = channel_bw(); _o->channel_bw = _e; } { auto _e = channel(); _o->channel = _e; } { auto _e = class_variant(); if (_e) _o->class_variant = _e->str(); } } inline flatbuffers::Offset signal_detail::Pack(flatbuffers::FlatBufferBuilder &_fbb, const signal_detailT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createsignal_detail(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createsignal_detail(flatbuffers::FlatBufferBuilder &_fbb, const signal_detailT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const signal_detailT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _type = _o->type.empty() ? 0 : _fbb.CreateString(_o->type); auto _mod_class = _o->mod_class.empty() ? 0 : _fbb.CreateString(_o->mod_class); auto _standard = _o->standard.empty() ? 0 : _fbb.CreateString(_o->standard); auto _carrier_variant = _o->carrier_variant.empty() ? 0 : _fbb.CreateString(_o->carrier_variant); auto _symbol_variant = _o->symbol_variant.empty() ? 0 : _fbb.CreateString(_o->symbol_variant); auto _order = _o->order; auto _duplexing = _o->duplexing.empty() ? 0 : _fbb.CreateString(_o->duplexing); auto _multiplexing = _o->multiplexing.empty() ? 0 : _fbb.CreateString(_o->multiplexing); auto _multiple_access = _o->multiple_access.empty() ? 0 : _fbb.CreateString(_o->multiple_access); auto _spreading = _o->spreading.empty() ? 0 : _fbb.CreateString(_o->spreading); auto _channel_bw = _o->channel_bw; auto _channel = _o->channel; auto _class_variant = _o->class_variant.empty() ? 0 : _fbb.CreateString(_o->class_variant); return sigmf::signal::Createsignal_detail( _fbb, _type, _mod_class, _standard, _carrier_variant, _symbol_variant, _order, _duplexing, _multiplexing, _multiple_access, _spreading, _channel_bw, _channel, _class_variant); } inline signal_emitterT *signal_emitter::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new signal_emitterT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void signal_emitter::UnPackTo(signal_emitterT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = seid(); _o->seid = _e; } { auto _e = manufacturer(); if (_e) _o->manufacturer = _e->str(); } { auto _e = power_tx(); _o->power_tx = _e; } { auto _e = power_eirp(); _o->power_eirp = _e; } { auto _e = geolocation(); if (_e) _o->geolocation = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset signal_emitter::Pack(flatbuffers::FlatBufferBuilder &_fbb, const signal_emitterT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createsignal_emitter(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createsignal_emitter(flatbuffers::FlatBufferBuilder &_fbb, const signal_emitterT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const signal_emitterT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _seid = _o->seid; auto _manufacturer = _o->manufacturer.empty() ? 0 : _fbb.CreateString(_o->manufacturer); auto _power_tx = _o->power_tx; auto _power_eirp = _o->power_eirp; auto _geolocation = _o->geolocation ? Creategeojson_point(_fbb, _o->geolocation.get(), _rehasher) : 0; return sigmf::signal::Createsignal_emitter( _fbb, _seid, _manufacturer, _power_tx, _power_eirp, _geolocation); } inline AnnotationT *Annotation::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new AnnotationT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Annotation::UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = detail(); if (_e) _o->detail = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = emitter(); if (_e) _o->emitter = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset Annotation::Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateAnnotation(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const AnnotationT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _detail = _o->detail ? Createsignal_detail(_fbb, _o->detail.get(), _rehasher) : 0; auto _emitter = _o->emitter ? Createsignal_emitter(_fbb, _o->emitter.get(), _rehasher) : 0; return sigmf::signal::CreateAnnotation( _fbb, _detail, _emitter); } inline DescrT *Descr::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new DescrT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Descr::UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = global(); if (_e) _o->global = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = annotation(); if (_e) _o->annotation = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = capture(); if (_e) _o->capture = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset Descr::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateDescr(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DescrT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _global = _o->global ? CreateGlobal(_fbb, _o->global.get(), _rehasher) : 0; auto _annotation = _o->annotation ? CreateAnnotation(_fbb, _o->annotation.get(), _rehasher) : 0; auto _capture = _o->capture ? CreateCapture(_fbb, _o->capture.get(), _rehasher) : 0; return sigmf::signal::CreateDescr( _fbb, _global, _annotation, _capture); } inline const flatbuffers::TypeTable *GlobalTypeTable() { static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr }; return &tt; } inline const flatbuffers::TypeTable *CaptureTypeTable() { static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr }; return &tt; } inline const flatbuffers::TypeTable *signal_detailTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 } }; static const char * const names[] = { "type", "mod_class", "standard", "carrier_variant", "symbol_variant", "order", "duplexing", "multiplexing", "multiple_access", "spreading", "channel_bw", "channel", "class_variant" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 13, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *signal_emitterTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_SEQUENCE, 0, 0 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::core::geojson_pointTypeTable }; static const char * const names[] = { "seid", "manufacturer", "power_tx", "power_eirp", "geolocation" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 5, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *AnnotationTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 1 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::signal::signal_detailTypeTable, sigmf::signal::signal_emitterTypeTable }; static const char * const names[] = { "detail", "emitter" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 2, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *DescrTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 1 }, { flatbuffers::ET_SEQUENCE, 0, 2 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::signal::GlobalTypeTable, sigmf::signal::AnnotationTypeTable, sigmf::signal::CaptureTypeTable }; static const char * const names[] = { "global", "annotation", "capture" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } } // namespace signal } // namespace sigmf #endif // FLATBUFFERS_GENERATED_SIGMFSIGNAL_SIGMF_SIGNAL_H_ libsigmf-1.0.2/sigmf_protocols/sigmf_spatial.fbs000066400000000000000000000017471434644465300220630ustar00rootroot00000000000000 namespace sigmf.spatial; table sigmf_bearing { azimuth:double=null; elevation:double=null; range:double=null; az_error:double=null; el_error:double=null; range_error:double=null; } table cartesian_point { point:[double]; unknown:bool=null; } table sigmf_calibration { caltype:string; // "tone", "xcorr", "ref", "other" bearing:sigmf_bearing; cal_geometry:cartesian_point; } table Global { num_elements:uint64=null; channel_index:uint64=null; } table Capture { aperture_azimuth:double=null; aperture_bearing:sigmf_bearing; emitter_bearing:sigmf_bearing; element_geometry:[cartesian_point]; phase_offset:double=null; calibration:sigmf_calibration; } table Annotation { signal_azimuth:double=null; signal_bearing:sigmf_bearing; } table Collection { element_geometry:[cartesian_point]; } table Descr { global:Global; annotation:Annotation; capture:Capture; collection:Collection; } libsigmf-1.0.2/sigmf_protocols/sigmf_spatial_generated.h000066400000000000000000001421141434644465300235500ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_SIGMFSPATIAL_SIGMF_SPATIAL_H_ #define FLATBUFFERS_GENERATED_SIGMFSPATIAL_SIGMF_SPATIAL_H_ #include "flatbuffers/flatbuffers.h" namespace sigmf { namespace spatial { struct sigmf_bearing; struct sigmf_bearingBuilder; struct sigmf_bearingT; struct cartesian_point; struct cartesian_pointBuilder; struct cartesian_pointT; struct sigmf_calibration; struct sigmf_calibrationBuilder; struct sigmf_calibrationT; struct Global; struct GlobalBuilder; struct GlobalT; struct Capture; struct CaptureBuilder; struct CaptureT; struct Annotation; struct AnnotationBuilder; struct AnnotationT; struct Collection; struct CollectionBuilder; struct CollectionT; struct Descr; struct DescrBuilder; struct DescrT; inline const flatbuffers::TypeTable *sigmf_bearingTypeTable(); inline const flatbuffers::TypeTable *cartesian_pointTypeTable(); inline const flatbuffers::TypeTable *sigmf_calibrationTypeTable(); inline const flatbuffers::TypeTable *GlobalTypeTable(); inline const flatbuffers::TypeTable *CaptureTypeTable(); inline const flatbuffers::TypeTable *AnnotationTypeTable(); inline const flatbuffers::TypeTable *CollectionTypeTable(); inline const flatbuffers::TypeTable *DescrTypeTable(); struct sigmf_bearingT : public flatbuffers::NativeTable { typedef sigmf_bearing TableType; flatbuffers::Optional azimuth = flatbuffers::nullopt; flatbuffers::Optional elevation = flatbuffers::nullopt; flatbuffers::Optional range = flatbuffers::nullopt; flatbuffers::Optional az_error = flatbuffers::nullopt; flatbuffers::Optional el_error = flatbuffers::nullopt; flatbuffers::Optional range_error = flatbuffers::nullopt; }; struct sigmf_bearing FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef sigmf_bearingT NativeTableType; typedef sigmf_bearingBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return sigmf_bearingTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_AZIMUTH = 4, VT_ELEVATION = 6, VT_RANGE = 8, VT_AZ_ERROR = 10, VT_EL_ERROR = 12, VT_RANGE_ERROR = 14 }; flatbuffers::Optional azimuth() const { return GetOptional(VT_AZIMUTH); } flatbuffers::Optional elevation() const { return GetOptional(VT_ELEVATION); } flatbuffers::Optional range() const { return GetOptional(VT_RANGE); } flatbuffers::Optional az_error() const { return GetOptional(VT_AZ_ERROR); } flatbuffers::Optional el_error() const { return GetOptional(VT_EL_ERROR); } flatbuffers::Optional range_error() const { return GetOptional(VT_RANGE_ERROR); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_AZIMUTH) && VerifyField(verifier, VT_ELEVATION) && VerifyField(verifier, VT_RANGE) && VerifyField(verifier, VT_AZ_ERROR) && VerifyField(verifier, VT_EL_ERROR) && VerifyField(verifier, VT_RANGE_ERROR) && verifier.EndTable(); } sigmf_bearingT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(sigmf_bearingT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_bearingT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct sigmf_bearingBuilder { typedef sigmf_bearing Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_azimuth(double azimuth) { fbb_.AddElement(sigmf_bearing::VT_AZIMUTH, azimuth); } void add_elevation(double elevation) { fbb_.AddElement(sigmf_bearing::VT_ELEVATION, elevation); } void add_range(double range) { fbb_.AddElement(sigmf_bearing::VT_RANGE, range); } void add_az_error(double az_error) { fbb_.AddElement(sigmf_bearing::VT_AZ_ERROR, az_error); } void add_el_error(double el_error) { fbb_.AddElement(sigmf_bearing::VT_EL_ERROR, el_error); } void add_range_error(double range_error) { fbb_.AddElement(sigmf_bearing::VT_RANGE_ERROR, range_error); } explicit sigmf_bearingBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createsigmf_bearing( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional azimuth = flatbuffers::nullopt, flatbuffers::Optional elevation = flatbuffers::nullopt, flatbuffers::Optional range = flatbuffers::nullopt, flatbuffers::Optional az_error = flatbuffers::nullopt, flatbuffers::Optional el_error = flatbuffers::nullopt, flatbuffers::Optional range_error = flatbuffers::nullopt) { sigmf_bearingBuilder builder_(_fbb); if(range_error) { builder_.add_range_error(*range_error); } if(el_error) { builder_.add_el_error(*el_error); } if(az_error) { builder_.add_az_error(*az_error); } if(range) { builder_.add_range(*range); } if(elevation) { builder_.add_elevation(*elevation); } if(azimuth) { builder_.add_azimuth(*azimuth); } return builder_.Finish(); } flatbuffers::Offset Createsigmf_bearing(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_bearingT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct cartesian_pointT : public flatbuffers::NativeTable { typedef cartesian_point TableType; std::vector point{}; flatbuffers::Optional unknown = flatbuffers::nullopt; }; struct cartesian_point FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef cartesian_pointT NativeTableType; typedef cartesian_pointBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return cartesian_pointTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_POINT = 4, VT_UNKNOWN = 6 }; const flatbuffers::Vector *point() const { return GetPointer *>(VT_POINT); } flatbuffers::Optional unknown() const { return GetOptional(VT_UNKNOWN); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_POINT) && verifier.VerifyVector(point()) && VerifyField(verifier, VT_UNKNOWN) && verifier.EndTable(); } cartesian_pointT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(cartesian_pointT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const cartesian_pointT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct cartesian_pointBuilder { typedef cartesian_point Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_point(flatbuffers::Offset> point) { fbb_.AddOffset(cartesian_point::VT_POINT, point); } void add_unknown(bool unknown) { fbb_.AddElement(cartesian_point::VT_UNKNOWN, static_cast(unknown)); } explicit cartesian_pointBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createcartesian_point( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset> point = 0, flatbuffers::Optional unknown = flatbuffers::nullopt) { cartesian_pointBuilder builder_(_fbb); builder_.add_point(point); if(unknown) { builder_.add_unknown(*unknown); } return builder_.Finish(); } inline flatbuffers::Offset Createcartesian_pointDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *point = nullptr, flatbuffers::Optional unknown = flatbuffers::nullopt) { auto point__ = point ? _fbb.CreateVector(*point) : 0; return sigmf::spatial::Createcartesian_point( _fbb, point__, unknown); } flatbuffers::Offset Createcartesian_point(flatbuffers::FlatBufferBuilder &_fbb, const cartesian_pointT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct sigmf_calibrationT : public flatbuffers::NativeTable { typedef sigmf_calibration TableType; std::string caltype{}; std::shared_ptr bearing{}; std::shared_ptr cal_geometry{}; }; struct sigmf_calibration FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef sigmf_calibrationT NativeTableType; typedef sigmf_calibrationBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return sigmf_calibrationTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_CALTYPE = 4, VT_BEARING = 6, VT_CAL_GEOMETRY = 8 }; const flatbuffers::String *caltype() const { return GetPointer(VT_CALTYPE); } const sigmf::spatial::sigmf_bearing *bearing() const { return GetPointer(VT_BEARING); } const sigmf::spatial::cartesian_point *cal_geometry() const { return GetPointer(VT_CAL_GEOMETRY); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_CALTYPE) && verifier.VerifyString(caltype()) && VerifyOffset(verifier, VT_BEARING) && verifier.VerifyTable(bearing()) && VerifyOffset(verifier, VT_CAL_GEOMETRY) && verifier.VerifyTable(cal_geometry()) && verifier.EndTable(); } sigmf_calibrationT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(sigmf_calibrationT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_calibrationT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct sigmf_calibrationBuilder { typedef sigmf_calibration Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_caltype(flatbuffers::Offset caltype) { fbb_.AddOffset(sigmf_calibration::VT_CALTYPE, caltype); } void add_bearing(flatbuffers::Offset bearing) { fbb_.AddOffset(sigmf_calibration::VT_BEARING, bearing); } void add_cal_geometry(flatbuffers::Offset cal_geometry) { fbb_.AddOffset(sigmf_calibration::VT_CAL_GEOMETRY, cal_geometry); } explicit sigmf_calibrationBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createsigmf_calibration( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset caltype = 0, flatbuffers::Offset bearing = 0, flatbuffers::Offset cal_geometry = 0) { sigmf_calibrationBuilder builder_(_fbb); builder_.add_cal_geometry(cal_geometry); builder_.add_bearing(bearing); builder_.add_caltype(caltype); return builder_.Finish(); } inline flatbuffers::Offset Createsigmf_calibrationDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *caltype = nullptr, flatbuffers::Offset bearing = 0, flatbuffers::Offset cal_geometry = 0) { auto caltype__ = caltype ? _fbb.CreateString(caltype) : 0; return sigmf::spatial::Createsigmf_calibration( _fbb, caltype__, bearing, cal_geometry); } flatbuffers::Offset Createsigmf_calibration(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_calibrationT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct GlobalT : public flatbuffers::NativeTable { typedef Global TableType; flatbuffers::Optional num_elements = flatbuffers::nullopt; flatbuffers::Optional channel_index = flatbuffers::nullopt; }; struct Global FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef GlobalT NativeTableType; typedef GlobalBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return GlobalTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_NUM_ELEMENTS = 4, VT_CHANNEL_INDEX = 6 }; flatbuffers::Optional num_elements() const { return GetOptional(VT_NUM_ELEMENTS); } flatbuffers::Optional channel_index() const { return GetOptional(VT_CHANNEL_INDEX); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_NUM_ELEMENTS) && VerifyField(verifier, VT_CHANNEL_INDEX) && verifier.EndTable(); } GlobalT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct GlobalBuilder { typedef Global Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_num_elements(uint64_t num_elements) { fbb_.AddElement(Global::VT_NUM_ELEMENTS, num_elements); } void add_channel_index(uint64_t channel_index) { fbb_.AddElement(Global::VT_CHANNEL_INDEX, channel_index); } explicit GlobalBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateGlobal( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional num_elements = flatbuffers::nullopt, flatbuffers::Optional channel_index = flatbuffers::nullopt) { GlobalBuilder builder_(_fbb); if(channel_index) { builder_.add_channel_index(*channel_index); } if(num_elements) { builder_.add_num_elements(*num_elements); } return builder_.Finish(); } flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct CaptureT : public flatbuffers::NativeTable { typedef Capture TableType; flatbuffers::Optional aperture_azimuth = flatbuffers::nullopt; std::shared_ptr aperture_bearing{}; std::shared_ptr emitter_bearing{}; std::vector> element_geometry{}; flatbuffers::Optional phase_offset = flatbuffers::nullopt; std::shared_ptr calibration{}; }; struct Capture FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CaptureT NativeTableType; typedef CaptureBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return CaptureTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_APERTURE_AZIMUTH = 4, VT_APERTURE_BEARING = 6, VT_EMITTER_BEARING = 8, VT_ELEMENT_GEOMETRY = 10, VT_PHASE_OFFSET = 12, VT_CALIBRATION = 14 }; flatbuffers::Optional aperture_azimuth() const { return GetOptional(VT_APERTURE_AZIMUTH); } const sigmf::spatial::sigmf_bearing *aperture_bearing() const { return GetPointer(VT_APERTURE_BEARING); } const sigmf::spatial::sigmf_bearing *emitter_bearing() const { return GetPointer(VT_EMITTER_BEARING); } const flatbuffers::Vector> *element_geometry() const { return GetPointer> *>(VT_ELEMENT_GEOMETRY); } flatbuffers::Optional phase_offset() const { return GetOptional(VT_PHASE_OFFSET); } const sigmf::spatial::sigmf_calibration *calibration() const { return GetPointer(VT_CALIBRATION); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_APERTURE_AZIMUTH) && VerifyOffset(verifier, VT_APERTURE_BEARING) && verifier.VerifyTable(aperture_bearing()) && VerifyOffset(verifier, VT_EMITTER_BEARING) && verifier.VerifyTable(emitter_bearing()) && VerifyOffset(verifier, VT_ELEMENT_GEOMETRY) && verifier.VerifyVector(element_geometry()) && verifier.VerifyVectorOfTables(element_geometry()) && VerifyField(verifier, VT_PHASE_OFFSET) && VerifyOffset(verifier, VT_CALIBRATION) && verifier.VerifyTable(calibration()) && verifier.EndTable(); } CaptureT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct CaptureBuilder { typedef Capture Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_aperture_azimuth(double aperture_azimuth) { fbb_.AddElement(Capture::VT_APERTURE_AZIMUTH, aperture_azimuth); } void add_aperture_bearing(flatbuffers::Offset aperture_bearing) { fbb_.AddOffset(Capture::VT_APERTURE_BEARING, aperture_bearing); } void add_emitter_bearing(flatbuffers::Offset emitter_bearing) { fbb_.AddOffset(Capture::VT_EMITTER_BEARING, emitter_bearing); } void add_element_geometry(flatbuffers::Offset>> element_geometry) { fbb_.AddOffset(Capture::VT_ELEMENT_GEOMETRY, element_geometry); } void add_phase_offset(double phase_offset) { fbb_.AddElement(Capture::VT_PHASE_OFFSET, phase_offset); } void add_calibration(flatbuffers::Offset calibration) { fbb_.AddOffset(Capture::VT_CALIBRATION, calibration); } explicit CaptureBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateCapture( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional aperture_azimuth = flatbuffers::nullopt, flatbuffers::Offset aperture_bearing = 0, flatbuffers::Offset emitter_bearing = 0, flatbuffers::Offset>> element_geometry = 0, flatbuffers::Optional phase_offset = flatbuffers::nullopt, flatbuffers::Offset calibration = 0) { CaptureBuilder builder_(_fbb); if(phase_offset) { builder_.add_phase_offset(*phase_offset); } if(aperture_azimuth) { builder_.add_aperture_azimuth(*aperture_azimuth); } builder_.add_calibration(calibration); builder_.add_element_geometry(element_geometry); builder_.add_emitter_bearing(emitter_bearing); builder_.add_aperture_bearing(aperture_bearing); return builder_.Finish(); } inline flatbuffers::Offset CreateCaptureDirect( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional aperture_azimuth = flatbuffers::nullopt, flatbuffers::Offset aperture_bearing = 0, flatbuffers::Offset emitter_bearing = 0, const std::vector> *element_geometry = nullptr, flatbuffers::Optional phase_offset = flatbuffers::nullopt, flatbuffers::Offset calibration = 0) { auto element_geometry__ = element_geometry ? _fbb.CreateVector>(*element_geometry) : 0; return sigmf::spatial::CreateCapture( _fbb, aperture_azimuth, aperture_bearing, emitter_bearing, element_geometry__, phase_offset, calibration); } flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct AnnotationT : public flatbuffers::NativeTable { typedef Annotation TableType; flatbuffers::Optional signal_azimuth = flatbuffers::nullopt; std::shared_ptr signal_bearing{}; }; struct Annotation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef AnnotationT NativeTableType; typedef AnnotationBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return AnnotationTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SIGNAL_AZIMUTH = 4, VT_SIGNAL_BEARING = 6 }; flatbuffers::Optional signal_azimuth() const { return GetOptional(VT_SIGNAL_AZIMUTH); } const sigmf::spatial::sigmf_bearing *signal_bearing() const { return GetPointer(VT_SIGNAL_BEARING); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_SIGNAL_AZIMUTH) && VerifyOffset(verifier, VT_SIGNAL_BEARING) && verifier.VerifyTable(signal_bearing()) && verifier.EndTable(); } AnnotationT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct AnnotationBuilder { typedef Annotation Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_signal_azimuth(double signal_azimuth) { fbb_.AddElement(Annotation::VT_SIGNAL_AZIMUTH, signal_azimuth); } void add_signal_bearing(flatbuffers::Offset signal_bearing) { fbb_.AddOffset(Annotation::VT_SIGNAL_BEARING, signal_bearing); } explicit AnnotationBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateAnnotation( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional signal_azimuth = flatbuffers::nullopt, flatbuffers::Offset signal_bearing = 0) { AnnotationBuilder builder_(_fbb); if(signal_azimuth) { builder_.add_signal_azimuth(*signal_azimuth); } builder_.add_signal_bearing(signal_bearing); return builder_.Finish(); } flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct CollectionT : public flatbuffers::NativeTable { typedef Collection TableType; std::vector> element_geometry{}; }; struct Collection FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CollectionT NativeTableType; typedef CollectionBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return CollectionTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_ELEMENT_GEOMETRY = 4 }; const flatbuffers::Vector> *element_geometry() const { return GetPointer> *>(VT_ELEMENT_GEOMETRY); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_ELEMENT_GEOMETRY) && verifier.VerifyVector(element_geometry()) && verifier.VerifyVectorOfTables(element_geometry()) && verifier.EndTable(); } CollectionT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(CollectionT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct CollectionBuilder { typedef Collection Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_element_geometry(flatbuffers::Offset>> element_geometry) { fbb_.AddOffset(Collection::VT_ELEMENT_GEOMETRY, element_geometry); } explicit CollectionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateCollection( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset>> element_geometry = 0) { CollectionBuilder builder_(_fbb); builder_.add_element_geometry(element_geometry); return builder_.Finish(); } inline flatbuffers::Offset CreateCollectionDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector> *element_geometry = nullptr) { auto element_geometry__ = element_geometry ? _fbb.CreateVector>(*element_geometry) : 0; return sigmf::spatial::CreateCollection( _fbb, element_geometry__); } flatbuffers::Offset CreateCollection(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct DescrT : public flatbuffers::NativeTable { typedef Descr TableType; std::shared_ptr global{}; std::shared_ptr annotation{}; std::shared_ptr capture{}; std::shared_ptr collection{}; }; struct Descr FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DescrT NativeTableType; typedef DescrBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return DescrTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_GLOBAL = 4, VT_ANNOTATION = 6, VT_CAPTURE = 8, VT_COLLECTION = 10 }; const sigmf::spatial::Global *global() const { return GetPointer(VT_GLOBAL); } const sigmf::spatial::Annotation *annotation() const { return GetPointer(VT_ANNOTATION); } const sigmf::spatial::Capture *capture() const { return GetPointer(VT_CAPTURE); } const sigmf::spatial::Collection *collection() const { return GetPointer(VT_COLLECTION); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_GLOBAL) && verifier.VerifyTable(global()) && VerifyOffset(verifier, VT_ANNOTATION) && verifier.VerifyTable(annotation()) && VerifyOffset(verifier, VT_CAPTURE) && verifier.VerifyTable(capture()) && VerifyOffset(verifier, VT_COLLECTION) && verifier.VerifyTable(collection()) && verifier.EndTable(); } DescrT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DescrBuilder { typedef Descr Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_global(flatbuffers::Offset global) { fbb_.AddOffset(Descr::VT_GLOBAL, global); } void add_annotation(flatbuffers::Offset annotation) { fbb_.AddOffset(Descr::VT_ANNOTATION, annotation); } void add_capture(flatbuffers::Offset capture) { fbb_.AddOffset(Descr::VT_CAPTURE, capture); } void add_collection(flatbuffers::Offset collection) { fbb_.AddOffset(Descr::VT_COLLECTION, collection); } explicit DescrBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateDescr( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset global = 0, flatbuffers::Offset annotation = 0, flatbuffers::Offset capture = 0, flatbuffers::Offset collection = 0) { DescrBuilder builder_(_fbb); builder_.add_collection(collection); builder_.add_capture(capture); builder_.add_annotation(annotation); builder_.add_global(global); return builder_.Finish(); } flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); inline sigmf_bearingT *sigmf_bearing::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new sigmf_bearingT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void sigmf_bearing::UnPackTo(sigmf_bearingT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = azimuth(); _o->azimuth = _e; } { auto _e = elevation(); _o->elevation = _e; } { auto _e = range(); _o->range = _e; } { auto _e = az_error(); _o->az_error = _e; } { auto _e = el_error(); _o->el_error = _e; } { auto _e = range_error(); _o->range_error = _e; } } inline flatbuffers::Offset sigmf_bearing::Pack(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_bearingT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createsigmf_bearing(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createsigmf_bearing(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_bearingT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const sigmf_bearingT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _azimuth = _o->azimuth; auto _elevation = _o->elevation; auto _range = _o->range; auto _az_error = _o->az_error; auto _el_error = _o->el_error; auto _range_error = _o->range_error; return sigmf::spatial::Createsigmf_bearing( _fbb, _azimuth, _elevation, _range, _az_error, _el_error, _range_error); } inline cartesian_pointT *cartesian_point::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new cartesian_pointT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void cartesian_point::UnPackTo(cartesian_pointT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = point(); if (_e) { _o->point.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->point[_i] = _e->Get(_i); } } } { auto _e = unknown(); _o->unknown = _e; } } inline flatbuffers::Offset cartesian_point::Pack(flatbuffers::FlatBufferBuilder &_fbb, const cartesian_pointT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createcartesian_point(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createcartesian_point(flatbuffers::FlatBufferBuilder &_fbb, const cartesian_pointT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const cartesian_pointT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _point = _o->point.size() ? _fbb.CreateVector(_o->point) : 0; auto _unknown = _o->unknown; return sigmf::spatial::Createcartesian_point( _fbb, _point, _unknown); } inline sigmf_calibrationT *sigmf_calibration::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new sigmf_calibrationT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void sigmf_calibration::UnPackTo(sigmf_calibrationT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = caltype(); if (_e) _o->caltype = _e->str(); } { auto _e = bearing(); if (_e) _o->bearing = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = cal_geometry(); if (_e) _o->cal_geometry = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset sigmf_calibration::Pack(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_calibrationT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createsigmf_calibration(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createsigmf_calibration(flatbuffers::FlatBufferBuilder &_fbb, const sigmf_calibrationT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const sigmf_calibrationT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _caltype = _o->caltype.empty() ? 0 : _fbb.CreateString(_o->caltype); auto _bearing = _o->bearing ? Createsigmf_bearing(_fbb, _o->bearing.get(), _rehasher) : 0; auto _cal_geometry = _o->cal_geometry ? Createcartesian_point(_fbb, _o->cal_geometry.get(), _rehasher) : 0; return sigmf::spatial::Createsigmf_calibration( _fbb, _caltype, _bearing, _cal_geometry); } inline GlobalT *Global::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new GlobalT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Global::UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = num_elements(); _o->num_elements = _e; } { auto _e = channel_index(); _o->channel_index = _e; } } inline flatbuffers::Offset Global::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateGlobal(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GlobalT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _num_elements = _o->num_elements; auto _channel_index = _o->channel_index; return sigmf::spatial::CreateGlobal( _fbb, _num_elements, _channel_index); } inline CaptureT *Capture::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new CaptureT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Capture::UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = aperture_azimuth(); _o->aperture_azimuth = _e; } { auto _e = aperture_bearing(); if (_e) _o->aperture_bearing = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = emitter_bearing(); if (_e) _o->emitter_bearing = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = element_geometry(); if (_e) { _o->element_geometry.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->element_geometry[_i] = std::shared_ptr(_e->Get(_i)->UnPack(_resolver)); } } } { auto _e = phase_offset(); _o->phase_offset = _e; } { auto _e = calibration(); if (_e) _o->calibration = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset Capture::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateCapture(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CaptureT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _aperture_azimuth = _o->aperture_azimuth; auto _aperture_bearing = _o->aperture_bearing ? Createsigmf_bearing(_fbb, _o->aperture_bearing.get(), _rehasher) : 0; auto _emitter_bearing = _o->emitter_bearing ? Createsigmf_bearing(_fbb, _o->emitter_bearing.get(), _rehasher) : 0; auto _element_geometry = _o->element_geometry.size() ? _fbb.CreateVector> (_o->element_geometry.size(), [](size_t i, _VectorArgs *__va) { return Createcartesian_point(*__va->__fbb, __va->__o->element_geometry[i].get(), __va->__rehasher); }, &_va ) : 0; auto _phase_offset = _o->phase_offset; auto _calibration = _o->calibration ? Createsigmf_calibration(_fbb, _o->calibration.get(), _rehasher) : 0; return sigmf::spatial::CreateCapture( _fbb, _aperture_azimuth, _aperture_bearing, _emitter_bearing, _element_geometry, _phase_offset, _calibration); } inline AnnotationT *Annotation::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new AnnotationT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Annotation::UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = signal_azimuth(); _o->signal_azimuth = _e; } { auto _e = signal_bearing(); if (_e) _o->signal_bearing = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset Annotation::Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateAnnotation(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const AnnotationT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _signal_azimuth = _o->signal_azimuth; auto _signal_bearing = _o->signal_bearing ? Createsigmf_bearing(_fbb, _o->signal_bearing.get(), _rehasher) : 0; return sigmf::spatial::CreateAnnotation( _fbb, _signal_azimuth, _signal_bearing); } inline CollectionT *Collection::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new CollectionT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Collection::UnPackTo(CollectionT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = element_geometry(); if (_e) { _o->element_geometry.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->element_geometry[_i] = std::shared_ptr(_e->Get(_i)->UnPack(_resolver)); } } } } inline flatbuffers::Offset Collection::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateCollection(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateCollection(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CollectionT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _element_geometry = _o->element_geometry.size() ? _fbb.CreateVector> (_o->element_geometry.size(), [](size_t i, _VectorArgs *__va) { return Createcartesian_point(*__va->__fbb, __va->__o->element_geometry[i].get(), __va->__rehasher); }, &_va ) : 0; return sigmf::spatial::CreateCollection( _fbb, _element_geometry); } inline DescrT *Descr::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new DescrT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Descr::UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = global(); if (_e) _o->global = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = annotation(); if (_e) _o->annotation = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = capture(); if (_e) _o->capture = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = collection(); if (_e) _o->collection = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset Descr::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateDescr(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DescrT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _global = _o->global ? CreateGlobal(_fbb, _o->global.get(), _rehasher) : 0; auto _annotation = _o->annotation ? CreateAnnotation(_fbb, _o->annotation.get(), _rehasher) : 0; auto _capture = _o->capture ? CreateCapture(_fbb, _o->capture.get(), _rehasher) : 0; auto _collection = _o->collection ? CreateCollection(_fbb, _o->collection.get(), _rehasher) : 0; return sigmf::spatial::CreateDescr( _fbb, _global, _annotation, _capture, _collection); } inline const flatbuffers::TypeTable *sigmf_bearingTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 } }; static const char * const names[] = { "azimuth", "elevation", "range", "az_error", "el_error", "range_error" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 6, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *cartesian_pointTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_DOUBLE, 1, -1 }, { flatbuffers::ET_BOOL, 0, -1 } }; static const char * const names[] = { "point", "unknown" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 2, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *sigmf_calibrationTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 1 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::spatial::sigmf_bearingTypeTable, sigmf::spatial::cartesian_pointTypeTable }; static const char * const names[] = { "caltype", "bearing", "cal_geometry" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *GlobalTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_ULONG, 0, -1 }, { flatbuffers::ET_ULONG, 0, -1 } }; static const char * const names[] = { "num_elements", "channel_index" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 2, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *CaptureTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 1, 1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_SEQUENCE, 0, 2 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::spatial::sigmf_bearingTypeTable, sigmf::spatial::cartesian_pointTypeTable, sigmf::spatial::sigmf_calibrationTypeTable }; static const char * const names[] = { "aperture_azimuth", "aperture_bearing", "emitter_bearing", "element_geometry", "phase_offset", "calibration" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 6, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *AnnotationTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_SEQUENCE, 0, 0 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::spatial::sigmf_bearingTypeTable }; static const char * const names[] = { "signal_azimuth", "signal_bearing" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 2, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *CollectionTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_SEQUENCE, 1, 0 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::spatial::cartesian_pointTypeTable }; static const char * const names[] = { "element_geometry" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 1, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *DescrTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 1 }, { flatbuffers::ET_SEQUENCE, 0, 2 }, { flatbuffers::ET_SEQUENCE, 0, 3 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::spatial::GlobalTypeTable, sigmf::spatial::AnnotationTypeTable, sigmf::spatial::CaptureTypeTable, sigmf::spatial::CollectionTypeTable }; static const char * const names[] = { "global", "annotation", "capture", "collection" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 4, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } } // namespace spatial } // namespace sigmf #endif // FLATBUFFERS_GENERATED_SIGMFSPATIAL_SIGMF_SPATIAL_H_ libsigmf-1.0.2/sigmf_protocols/sigmf_wifi.fbs000066400000000000000000000005331434644465300213540ustar00rootroot00000000000000 namespace sigmf.wifi; table Global { /*`wifi` does not extend `global`*/ } table Capture { /*`wifi` does not extend `captures`*/ } table Annotation { downlink_format:long=null; message_type:long=null; ICA_address:double=null; binary:string; } table Descr { global:Global; annotation:Annotation; capture:Capture; } libsigmf-1.0.2/sigmf_protocols/sigmf_wifi_generated.h000066400000000000000000000427641434644465300230630ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_SIGMFWIFI_SIGMF_WIFI_H_ #define FLATBUFFERS_GENERATED_SIGMFWIFI_SIGMF_WIFI_H_ #include "flatbuffers/flatbuffers.h" namespace sigmf { namespace wifi { struct Global; struct GlobalBuilder; struct GlobalT; struct Capture; struct CaptureBuilder; struct CaptureT; struct Annotation; struct AnnotationBuilder; struct AnnotationT; struct Descr; struct DescrBuilder; struct DescrT; inline const flatbuffers::TypeTable *GlobalTypeTable(); inline const flatbuffers::TypeTable *CaptureTypeTable(); inline const flatbuffers::TypeTable *AnnotationTypeTable(); inline const flatbuffers::TypeTable *DescrTypeTable(); struct GlobalT : public flatbuffers::NativeTable { typedef Global TableType; }; struct Global FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef GlobalT NativeTableType; typedef GlobalBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return GlobalTypeTable(); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } GlobalT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct GlobalBuilder { typedef Global Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; explicit GlobalBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateGlobal( flatbuffers::FlatBufferBuilder &_fbb) { GlobalBuilder builder_(_fbb); return builder_.Finish(); } flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct CaptureT : public flatbuffers::NativeTable { typedef Capture TableType; }; struct Capture FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CaptureT NativeTableType; typedef CaptureBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return CaptureTypeTable(); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } CaptureT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct CaptureBuilder { typedef Capture Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; explicit CaptureBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateCapture( flatbuffers::FlatBufferBuilder &_fbb) { CaptureBuilder builder_(_fbb); return builder_.Finish(); } flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct AnnotationT : public flatbuffers::NativeTable { typedef Annotation TableType; flatbuffers::Optional downlink_format = flatbuffers::nullopt; flatbuffers::Optional message_type = flatbuffers::nullopt; flatbuffers::Optional ICA_address = flatbuffers::nullopt; std::string binary{}; }; struct Annotation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef AnnotationT NativeTableType; typedef AnnotationBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return AnnotationTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_DOWNLINK_FORMAT = 4, VT_MESSAGE_TYPE = 6, VT_ICA_ADDRESS = 8, VT_BINARY = 10 }; flatbuffers::Optional downlink_format() const { return GetOptional(VT_DOWNLINK_FORMAT); } flatbuffers::Optional message_type() const { return GetOptional(VT_MESSAGE_TYPE); } flatbuffers::Optional ICA_address() const { return GetOptional(VT_ICA_ADDRESS); } const flatbuffers::String *binary() const { return GetPointer(VT_BINARY); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_DOWNLINK_FORMAT) && VerifyField(verifier, VT_MESSAGE_TYPE) && VerifyField(verifier, VT_ICA_ADDRESS) && VerifyOffset(verifier, VT_BINARY) && verifier.VerifyString(binary()) && verifier.EndTable(); } AnnotationT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct AnnotationBuilder { typedef Annotation Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_downlink_format(int64_t downlink_format) { fbb_.AddElement(Annotation::VT_DOWNLINK_FORMAT, downlink_format); } void add_message_type(int64_t message_type) { fbb_.AddElement(Annotation::VT_MESSAGE_TYPE, message_type); } void add_ICA_address(double ICA_address) { fbb_.AddElement(Annotation::VT_ICA_ADDRESS, ICA_address); } void add_binary(flatbuffers::Offset binary) { fbb_.AddOffset(Annotation::VT_BINARY, binary); } explicit AnnotationBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateAnnotation( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional downlink_format = flatbuffers::nullopt, flatbuffers::Optional message_type = flatbuffers::nullopt, flatbuffers::Optional ICA_address = flatbuffers::nullopt, flatbuffers::Offset binary = 0) { AnnotationBuilder builder_(_fbb); if(ICA_address) { builder_.add_ICA_address(*ICA_address); } if(message_type) { builder_.add_message_type(*message_type); } if(downlink_format) { builder_.add_downlink_format(*downlink_format); } builder_.add_binary(binary); return builder_.Finish(); } inline flatbuffers::Offset CreateAnnotationDirect( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Optional downlink_format = flatbuffers::nullopt, flatbuffers::Optional message_type = flatbuffers::nullopt, flatbuffers::Optional ICA_address = flatbuffers::nullopt, const char *binary = nullptr) { auto binary__ = binary ? _fbb.CreateString(binary) : 0; return sigmf::wifi::CreateAnnotation( _fbb, downlink_format, message_type, ICA_address, binary__); } flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct DescrT : public flatbuffers::NativeTable { typedef Descr TableType; std::shared_ptr global{}; std::shared_ptr annotation{}; std::shared_ptr capture{}; }; struct Descr FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DescrT NativeTableType; typedef DescrBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return DescrTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_GLOBAL = 4, VT_ANNOTATION = 6, VT_CAPTURE = 8 }; const sigmf::wifi::Global *global() const { return GetPointer(VT_GLOBAL); } const sigmf::wifi::Annotation *annotation() const { return GetPointer(VT_ANNOTATION); } const sigmf::wifi::Capture *capture() const { return GetPointer(VT_CAPTURE); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_GLOBAL) && verifier.VerifyTable(global()) && VerifyOffset(verifier, VT_ANNOTATION) && verifier.VerifyTable(annotation()) && VerifyOffset(verifier, VT_CAPTURE) && verifier.VerifyTable(capture()) && verifier.EndTable(); } DescrT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DescrBuilder { typedef Descr Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_global(flatbuffers::Offset global) { fbb_.AddOffset(Descr::VT_GLOBAL, global); } void add_annotation(flatbuffers::Offset annotation) { fbb_.AddOffset(Descr::VT_ANNOTATION, annotation); } void add_capture(flatbuffers::Offset capture) { fbb_.AddOffset(Descr::VT_CAPTURE, capture); } explicit DescrBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateDescr( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset global = 0, flatbuffers::Offset annotation = 0, flatbuffers::Offset capture = 0) { DescrBuilder builder_(_fbb); builder_.add_capture(capture); builder_.add_annotation(annotation); builder_.add_global(global); return builder_.Finish(); } flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); inline GlobalT *Global::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new GlobalT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Global::UnPackTo(GlobalT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; } inline flatbuffers::Offset Global::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateGlobal(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateGlobal(flatbuffers::FlatBufferBuilder &_fbb, const GlobalT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GlobalT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; return sigmf::wifi::CreateGlobal( _fbb); } inline CaptureT *Capture::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new CaptureT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Capture::UnPackTo(CaptureT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; } inline flatbuffers::Offset Capture::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateCapture(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateCapture(flatbuffers::FlatBufferBuilder &_fbb, const CaptureT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CaptureT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; return sigmf::wifi::CreateCapture( _fbb); } inline AnnotationT *Annotation::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new AnnotationT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Annotation::UnPackTo(AnnotationT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = downlink_format(); _o->downlink_format = _e; } { auto _e = message_type(); _o->message_type = _e; } { auto _e = ICA_address(); _o->ICA_address = _e; } { auto _e = binary(); if (_e) _o->binary = _e->str(); } } inline flatbuffers::Offset Annotation::Pack(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateAnnotation(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateAnnotation(flatbuffers::FlatBufferBuilder &_fbb, const AnnotationT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const AnnotationT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _downlink_format = _o->downlink_format; auto _message_type = _o->message_type; auto _ICA_address = _o->ICA_address; auto _binary = _o->binary.empty() ? 0 : _fbb.CreateString(_o->binary); return sigmf::wifi::CreateAnnotation( _fbb, _downlink_format, _message_type, _ICA_address, _binary); } inline DescrT *Descr::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new DescrT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void Descr::UnPackTo(DescrT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = global(); if (_e) _o->global = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = annotation(); if (_e) _o->annotation = std::shared_ptr(_e->UnPack(_resolver)); } { auto _e = capture(); if (_e) _o->capture = std::shared_ptr(_e->UnPack(_resolver)); } } inline flatbuffers::Offset Descr::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DescrT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return CreateDescr(_fbb, _o, _rehasher); } inline flatbuffers::Offset CreateDescr(flatbuffers::FlatBufferBuilder &_fbb, const DescrT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DescrT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _global = _o->global ? CreateGlobal(_fbb, _o->global.get(), _rehasher) : 0; auto _annotation = _o->annotation ? CreateAnnotation(_fbb, _o->annotation.get(), _rehasher) : 0; auto _capture = _o->capture ? CreateCapture(_fbb, _o->capture.get(), _rehasher) : 0; return sigmf::wifi::CreateDescr( _fbb, _global, _annotation, _capture); } inline const flatbuffers::TypeTable *GlobalTypeTable() { static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr }; return &tt; } inline const flatbuffers::TypeTable *CaptureTypeTable() { static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr }; return &tt; } inline const flatbuffers::TypeTable *AnnotationTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_LONG, 0, -1 }, { flatbuffers::ET_LONG, 0, -1 }, { flatbuffers::ET_DOUBLE, 0, -1 }, { flatbuffers::ET_STRING, 0, -1 } }; static const char * const names[] = { "downlink_format", "message_type", "ICA_address", "binary" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 4, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *DescrTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 1 }, { flatbuffers::ET_SEQUENCE, 0, 2 } }; static const flatbuffers::TypeFunction type_refs[] = { sigmf::wifi::GlobalTypeTable, sigmf::wifi::AnnotationTypeTable, sigmf::wifi::CaptureTypeTable }; static const char * const names[] = { "global", "annotation", "capture" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } } // namespace wifi } // namespace sigmf #endif // FLATBUFFERS_GENERATED_SIGMFWIFI_SIGMF_WIFI_H_ libsigmf-1.0.2/sigmf_protocols/testing_protocols.fbs000066400000000000000000000007071434644465300230150ustar00rootroot00000000000000 table testing_vecs { myvecfortesting: [uint32]; name: string; } table one { fieldone: float; } table two { fieldtwo: float; } table three { fieldthree: float; } table very_nested_thing { wow: uint64; } table composed_type { name: string; comments: [string]; index: int32; nnnnnn: [very_nested_thing]; } union myunion { one, two, three } table testingunions { myfield: myunion; dumbfield: int; } libsigmf-1.0.2/sigmf_protocols/testing_protocols_generated.h000066400000000000000000001154261434644465300245150ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_TESTINGPROTOCOLS_H_ #define FLATBUFFERS_GENERATED_TESTINGPROTOCOLS_H_ #include "flatbuffers/flatbuffers.h" struct testing_vecs; struct testing_vecsBuilder; struct testing_vecsT; struct one; struct oneBuilder; struct oneT; struct two; struct twoBuilder; struct twoT; struct three; struct threeBuilder; struct threeT; struct very_nested_thing; struct very_nested_thingBuilder; struct very_nested_thingT; struct composed_type; struct composed_typeBuilder; struct composed_typeT; struct testingunions; struct testingunionsBuilder; struct testingunionsT; inline const flatbuffers::TypeTable *testing_vecsTypeTable(); inline const flatbuffers::TypeTable *oneTypeTable(); inline const flatbuffers::TypeTable *twoTypeTable(); inline const flatbuffers::TypeTable *threeTypeTable(); inline const flatbuffers::TypeTable *very_nested_thingTypeTable(); inline const flatbuffers::TypeTable *composed_typeTypeTable(); inline const flatbuffers::TypeTable *testingunionsTypeTable(); enum myunion : uint8_t { myunion_NONE = 0, myunion_one = 1, myunion_two = 2, myunion_three = 3, myunion_MIN = myunion_NONE, myunion_MAX = myunion_three }; inline const myunion (&EnumValuesmyunion())[4] { static const myunion values[] = { myunion_NONE, myunion_one, myunion_two, myunion_three }; return values; } inline const char * const *EnumNamesmyunion() { static const char * const names[5] = { "NONE", "one", "two", "three", nullptr }; return names; } inline const char *EnumNamemyunion(myunion e) { if (flatbuffers::IsOutRange(e, myunion_NONE, myunion_three)) return ""; const size_t index = static_cast(e); return EnumNamesmyunion()[index]; } template struct myunionTraits { static const myunion enum_value = myunion_NONE; }; template<> struct myunionTraits { static const myunion enum_value = myunion_one; }; template<> struct myunionTraits { static const myunion enum_value = myunion_two; }; template<> struct myunionTraits { static const myunion enum_value = myunion_three; }; struct myunionUnion { myunion type; void *value; myunionUnion() : type(myunion_NONE), value(nullptr) {} myunionUnion(myunionUnion&& u) FLATBUFFERS_NOEXCEPT : type(myunion_NONE), value(nullptr) { std::swap(type, u.type); std::swap(value, u.value); } myunionUnion(const myunionUnion &); myunionUnion &operator=(const myunionUnion &u) { myunionUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; } myunionUnion &operator=(myunionUnion &&u) FLATBUFFERS_NOEXCEPT { std::swap(type, u.type); std::swap(value, u.value); return *this; } ~myunionUnion() { Reset(); } void Reset(); #ifndef FLATBUFFERS_CPP98_STL template void Set(T&& val) { using RT = typename std::remove_reference::type; Reset(); type = myunionTraits::enum_value; if (type != myunion_NONE) { value = new RT(std::forward(val)); } } #endif // FLATBUFFERS_CPP98_STL static void *UnPack(const void *obj, myunion type, const flatbuffers::resolver_function_t *resolver); flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher = nullptr) const; oneT *Asone() { return type == myunion_one ? reinterpret_cast(value) : nullptr; } const oneT *Asone() const { return type == myunion_one ? reinterpret_cast(value) : nullptr; } twoT *Astwo() { return type == myunion_two ? reinterpret_cast(value) : nullptr; } const twoT *Astwo() const { return type == myunion_two ? reinterpret_cast(value) : nullptr; } threeT *Asthree() { return type == myunion_three ? reinterpret_cast(value) : nullptr; } const threeT *Asthree() const { return type == myunion_three ? reinterpret_cast(value) : nullptr; } }; bool Verifymyunion(flatbuffers::Verifier &verifier, const void *obj, myunion type); bool VerifymyunionVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); struct testing_vecsT : public flatbuffers::NativeTable { typedef testing_vecs TableType; std::vector myvecfortesting{}; std::string name{}; }; struct testing_vecs FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef testing_vecsT NativeTableType; typedef testing_vecsBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return testing_vecsTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_MYVECFORTESTING = 4, VT_NAME = 6 }; const flatbuffers::Vector *myvecfortesting() const { return GetPointer *>(VT_MYVECFORTESTING); } const flatbuffers::String *name() const { return GetPointer(VT_NAME); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_MYVECFORTESTING) && verifier.VerifyVector(myvecfortesting()) && VerifyOffset(verifier, VT_NAME) && verifier.VerifyString(name()) && verifier.EndTable(); } testing_vecsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(testing_vecsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const testing_vecsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct testing_vecsBuilder { typedef testing_vecs Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_myvecfortesting(flatbuffers::Offset> myvecfortesting) { fbb_.AddOffset(testing_vecs::VT_MYVECFORTESTING, myvecfortesting); } void add_name(flatbuffers::Offset name) { fbb_.AddOffset(testing_vecs::VT_NAME, name); } explicit testing_vecsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createtesting_vecs( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset> myvecfortesting = 0, flatbuffers::Offset name = 0) { testing_vecsBuilder builder_(_fbb); builder_.add_name(name); builder_.add_myvecfortesting(myvecfortesting); return builder_.Finish(); } inline flatbuffers::Offset Createtesting_vecsDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *myvecfortesting = nullptr, const char *name = nullptr) { auto myvecfortesting__ = myvecfortesting ? _fbb.CreateVector(*myvecfortesting) : 0; auto name__ = name ? _fbb.CreateString(name) : 0; return Createtesting_vecs( _fbb, myvecfortesting__, name__); } flatbuffers::Offset Createtesting_vecs(flatbuffers::FlatBufferBuilder &_fbb, const testing_vecsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct oneT : public flatbuffers::NativeTable { typedef one TableType; float fieldone = 0.0f; }; struct one FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef oneT NativeTableType; typedef oneBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return oneTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_FIELDONE = 4 }; float fieldone() const { return GetField(VT_FIELDONE, 0.0f); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_FIELDONE) && verifier.EndTable(); } oneT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(oneT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const oneT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct oneBuilder { typedef one Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_fieldone(float fieldone) { fbb_.AddElement(one::VT_FIELDONE, fieldone, 0.0f); } explicit oneBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createone( flatbuffers::FlatBufferBuilder &_fbb, float fieldone = 0.0f) { oneBuilder builder_(_fbb); builder_.add_fieldone(fieldone); return builder_.Finish(); } flatbuffers::Offset Createone(flatbuffers::FlatBufferBuilder &_fbb, const oneT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct twoT : public flatbuffers::NativeTable { typedef two TableType; float fieldtwo = 0.0f; }; struct two FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef twoT NativeTableType; typedef twoBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return twoTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_FIELDTWO = 4 }; float fieldtwo() const { return GetField(VT_FIELDTWO, 0.0f); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_FIELDTWO) && verifier.EndTable(); } twoT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(twoT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const twoT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct twoBuilder { typedef two Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_fieldtwo(float fieldtwo) { fbb_.AddElement(two::VT_FIELDTWO, fieldtwo, 0.0f); } explicit twoBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createtwo( flatbuffers::FlatBufferBuilder &_fbb, float fieldtwo = 0.0f) { twoBuilder builder_(_fbb); builder_.add_fieldtwo(fieldtwo); return builder_.Finish(); } flatbuffers::Offset Createtwo(flatbuffers::FlatBufferBuilder &_fbb, const twoT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct threeT : public flatbuffers::NativeTable { typedef three TableType; float fieldthree = 0.0f; }; struct three FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef threeT NativeTableType; typedef threeBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return threeTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_FIELDTHREE = 4 }; float fieldthree() const { return GetField(VT_FIELDTHREE, 0.0f); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_FIELDTHREE) && verifier.EndTable(); } threeT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(threeT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const threeT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct threeBuilder { typedef three Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_fieldthree(float fieldthree) { fbb_.AddElement(three::VT_FIELDTHREE, fieldthree, 0.0f); } explicit threeBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createthree( flatbuffers::FlatBufferBuilder &_fbb, float fieldthree = 0.0f) { threeBuilder builder_(_fbb); builder_.add_fieldthree(fieldthree); return builder_.Finish(); } flatbuffers::Offset Createthree(flatbuffers::FlatBufferBuilder &_fbb, const threeT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct very_nested_thingT : public flatbuffers::NativeTable { typedef very_nested_thing TableType; uint64_t wow = 0; }; struct very_nested_thing FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef very_nested_thingT NativeTableType; typedef very_nested_thingBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return very_nested_thingTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_WOW = 4 }; uint64_t wow() const { return GetField(VT_WOW, 0); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_WOW) && verifier.EndTable(); } very_nested_thingT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(very_nested_thingT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const very_nested_thingT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct very_nested_thingBuilder { typedef very_nested_thing Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_wow(uint64_t wow) { fbb_.AddElement(very_nested_thing::VT_WOW, wow, 0); } explicit very_nested_thingBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createvery_nested_thing( flatbuffers::FlatBufferBuilder &_fbb, uint64_t wow = 0) { very_nested_thingBuilder builder_(_fbb); builder_.add_wow(wow); return builder_.Finish(); } flatbuffers::Offset Createvery_nested_thing(flatbuffers::FlatBufferBuilder &_fbb, const very_nested_thingT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct composed_typeT : public flatbuffers::NativeTable { typedef composed_type TableType; std::string name{}; std::vector comments{}; int32_t index = 0; std::vector> nnnnnn{}; }; struct composed_type FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef composed_typeT NativeTableType; typedef composed_typeBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return composed_typeTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_NAME = 4, VT_COMMENTS = 6, VT_INDEX = 8, VT_NNNNNN = 10 }; const flatbuffers::String *name() const { return GetPointer(VT_NAME); } const flatbuffers::Vector> *comments() const { return GetPointer> *>(VT_COMMENTS); } int32_t index() const { return GetField(VT_INDEX, 0); } const flatbuffers::Vector> *nnnnnn() const { return GetPointer> *>(VT_NNNNNN); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_NAME) && verifier.VerifyString(name()) && VerifyOffset(verifier, VT_COMMENTS) && verifier.VerifyVector(comments()) && verifier.VerifyVectorOfStrings(comments()) && VerifyField(verifier, VT_INDEX) && VerifyOffset(verifier, VT_NNNNNN) && verifier.VerifyVector(nnnnnn()) && verifier.VerifyVectorOfTables(nnnnnn()) && verifier.EndTable(); } composed_typeT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(composed_typeT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const composed_typeT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct composed_typeBuilder { typedef composed_type Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_name(flatbuffers::Offset name) { fbb_.AddOffset(composed_type::VT_NAME, name); } void add_comments(flatbuffers::Offset>> comments) { fbb_.AddOffset(composed_type::VT_COMMENTS, comments); } void add_index(int32_t index) { fbb_.AddElement(composed_type::VT_INDEX, index, 0); } void add_nnnnnn(flatbuffers::Offset>> nnnnnn) { fbb_.AddOffset(composed_type::VT_NNNNNN, nnnnnn); } explicit composed_typeBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createcomposed_type( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset name = 0, flatbuffers::Offset>> comments = 0, int32_t index = 0, flatbuffers::Offset>> nnnnnn = 0) { composed_typeBuilder builder_(_fbb); builder_.add_nnnnnn(nnnnnn); builder_.add_index(index); builder_.add_comments(comments); builder_.add_name(name); return builder_.Finish(); } inline flatbuffers::Offset Createcomposed_typeDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *name = nullptr, const std::vector> *comments = nullptr, int32_t index = 0, const std::vector> *nnnnnn = nullptr) { auto name__ = name ? _fbb.CreateString(name) : 0; auto comments__ = comments ? _fbb.CreateVector>(*comments) : 0; auto nnnnnn__ = nnnnnn ? _fbb.CreateVector>(*nnnnnn) : 0; return Createcomposed_type( _fbb, name__, comments__, index, nnnnnn__); } flatbuffers::Offset Createcomposed_type(flatbuffers::FlatBufferBuilder &_fbb, const composed_typeT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct testingunionsT : public flatbuffers::NativeTable { typedef testingunions TableType; myunionUnion myfield{}; int32_t dumbfield = 0; }; struct testingunions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef testingunionsT NativeTableType; typedef testingunionsBuilder Builder; static const flatbuffers::TypeTable *MiniReflectTypeTable() { return testingunionsTypeTable(); } enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_MYFIELD_TYPE = 4, VT_MYFIELD = 6, VT_DUMBFIELD = 8 }; myunion myfield_type() const { return static_cast(GetField(VT_MYFIELD_TYPE, 0)); } const void *myfield() const { return GetPointer(VT_MYFIELD); } template const T *myfield_as() const; const one *myfield_as_one() const { return myfield_type() == myunion_one ? static_cast(myfield()) : nullptr; } const two *myfield_as_two() const { return myfield_type() == myunion_two ? static_cast(myfield()) : nullptr; } const three *myfield_as_three() const { return myfield_type() == myunion_three ? static_cast(myfield()) : nullptr; } int32_t dumbfield() const { return GetField(VT_DUMBFIELD, 0); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_MYFIELD_TYPE) && VerifyOffset(verifier, VT_MYFIELD) && Verifymyunion(verifier, myfield(), myfield_type()) && VerifyField(verifier, VT_DUMBFIELD) && verifier.EndTable(); } testingunionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(testingunionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const testingunionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; template<> inline const one *testingunions::myfield_as() const { return myfield_as_one(); } template<> inline const two *testingunions::myfield_as() const { return myfield_as_two(); } template<> inline const three *testingunions::myfield_as() const { return myfield_as_three(); } struct testingunionsBuilder { typedef testingunions Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_myfield_type(myunion myfield_type) { fbb_.AddElement(testingunions::VT_MYFIELD_TYPE, static_cast(myfield_type), 0); } void add_myfield(flatbuffers::Offset myfield) { fbb_.AddOffset(testingunions::VT_MYFIELD, myfield); } void add_dumbfield(int32_t dumbfield) { fbb_.AddElement(testingunions::VT_DUMBFIELD, dumbfield, 0); } explicit testingunionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset Createtestingunions( flatbuffers::FlatBufferBuilder &_fbb, myunion myfield_type = myunion_NONE, flatbuffers::Offset myfield = 0, int32_t dumbfield = 0) { testingunionsBuilder builder_(_fbb); builder_.add_dumbfield(dumbfield); builder_.add_myfield(myfield); builder_.add_myfield_type(myfield_type); return builder_.Finish(); } flatbuffers::Offset Createtestingunions(flatbuffers::FlatBufferBuilder &_fbb, const testingunionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); inline testing_vecsT *testing_vecs::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new testing_vecsT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void testing_vecs::UnPackTo(testing_vecsT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = myvecfortesting(); if (_e) { _o->myvecfortesting.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->myvecfortesting[_i] = _e->Get(_i); } } } { auto _e = name(); if (_e) _o->name = _e->str(); } } inline flatbuffers::Offset testing_vecs::Pack(flatbuffers::FlatBufferBuilder &_fbb, const testing_vecsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createtesting_vecs(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createtesting_vecs(flatbuffers::FlatBufferBuilder &_fbb, const testing_vecsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const testing_vecsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _myvecfortesting = _o->myvecfortesting.size() ? _fbb.CreateVector(_o->myvecfortesting) : 0; auto _name = _o->name.empty() ? 0 : _fbb.CreateString(_o->name); return Createtesting_vecs( _fbb, _myvecfortesting, _name); } inline oneT *one::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new oneT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void one::UnPackTo(oneT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = fieldone(); _o->fieldone = _e; } } inline flatbuffers::Offset one::Pack(flatbuffers::FlatBufferBuilder &_fbb, const oneT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createone(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createone(flatbuffers::FlatBufferBuilder &_fbb, const oneT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const oneT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _fieldone = _o->fieldone; return Createone( _fbb, _fieldone); } inline twoT *two::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new twoT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void two::UnPackTo(twoT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = fieldtwo(); _o->fieldtwo = _e; } } inline flatbuffers::Offset two::Pack(flatbuffers::FlatBufferBuilder &_fbb, const twoT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createtwo(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createtwo(flatbuffers::FlatBufferBuilder &_fbb, const twoT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const twoT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _fieldtwo = _o->fieldtwo; return Createtwo( _fbb, _fieldtwo); } inline threeT *three::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new threeT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void three::UnPackTo(threeT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = fieldthree(); _o->fieldthree = _e; } } inline flatbuffers::Offset three::Pack(flatbuffers::FlatBufferBuilder &_fbb, const threeT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createthree(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createthree(flatbuffers::FlatBufferBuilder &_fbb, const threeT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const threeT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _fieldthree = _o->fieldthree; return Createthree( _fbb, _fieldthree); } inline very_nested_thingT *very_nested_thing::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new very_nested_thingT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void very_nested_thing::UnPackTo(very_nested_thingT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = wow(); _o->wow = _e; } } inline flatbuffers::Offset very_nested_thing::Pack(flatbuffers::FlatBufferBuilder &_fbb, const very_nested_thingT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createvery_nested_thing(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createvery_nested_thing(flatbuffers::FlatBufferBuilder &_fbb, const very_nested_thingT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const very_nested_thingT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _wow = _o->wow; return Createvery_nested_thing( _fbb, _wow); } inline composed_typeT *composed_type::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new composed_typeT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void composed_type::UnPackTo(composed_typeT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = name(); if (_e) _o->name = _e->str(); } { auto _e = comments(); if (_e) { _o->comments.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->comments[_i] = _e->Get(_i)->str(); } } } { auto _e = index(); _o->index = _e; } { auto _e = nnnnnn(); if (_e) { _o->nnnnnn.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->nnnnnn[_i] = std::shared_ptr(_e->Get(_i)->UnPack(_resolver)); } } } } inline flatbuffers::Offset composed_type::Pack(flatbuffers::FlatBufferBuilder &_fbb, const composed_typeT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createcomposed_type(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createcomposed_type(flatbuffers::FlatBufferBuilder &_fbb, const composed_typeT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const composed_typeT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _name = _o->name.empty() ? 0 : _fbb.CreateString(_o->name); auto _comments = _o->comments.size() ? _fbb.CreateVectorOfStrings(_o->comments) : 0; auto _index = _o->index; auto _nnnnnn = _o->nnnnnn.size() ? _fbb.CreateVector> (_o->nnnnnn.size(), [](size_t i, _VectorArgs *__va) { return Createvery_nested_thing(*__va->__fbb, __va->__o->nnnnnn[i].get(), __va->__rehasher); }, &_va ) : 0; return Createcomposed_type( _fbb, _name, _comments, _index, _nnnnnn); } inline testingunionsT *testingunions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { auto _o = std::unique_ptr(new testingunionsT()); UnPackTo(_o.get(), _resolver); return _o.release(); } inline void testingunions::UnPackTo(testingunionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { (void)_o; (void)_resolver; { auto _e = myfield_type(); _o->myfield.type = _e; } { auto _e = myfield(); if (_e) _o->myfield.value = myunionUnion::UnPack(_e, myfield_type(), _resolver); } { auto _e = dumbfield(); _o->dumbfield = _e; } } inline flatbuffers::Offset testingunions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const testingunionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { return Createtestingunions(_fbb, _o, _rehasher); } inline flatbuffers::Offset Createtestingunions(flatbuffers::FlatBufferBuilder &_fbb, const testingunionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const testingunionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _myfield_type = _o->myfield.type; auto _myfield = _o->myfield.Pack(_fbb); auto _dumbfield = _o->dumbfield; return Createtestingunions( _fbb, _myfield_type, _myfield, _dumbfield); } inline bool Verifymyunion(flatbuffers::Verifier &verifier, const void *obj, myunion type) { switch (type) { case myunion_NONE: { return true; } case myunion_one: { auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case myunion_two: { auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case myunion_three: { auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } default: return true; } } inline bool VerifymyunionVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { if (!values || !types) return !values && !types; if (values->size() != types->size()) return false; for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { if (!Verifymyunion( verifier, values->Get(i), types->GetEnum(i))) { return false; } } return true; } inline void *myunionUnion::UnPack(const void *obj, myunion type, const flatbuffers::resolver_function_t *resolver) { switch (type) { case myunion_one: { auto ptr = reinterpret_cast(obj); return ptr->UnPack(resolver); } case myunion_two: { auto ptr = reinterpret_cast(obj); return ptr->UnPack(resolver); } case myunion_three: { auto ptr = reinterpret_cast(obj); return ptr->UnPack(resolver); } default: return nullptr; } } inline flatbuffers::Offset myunionUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const { switch (type) { case myunion_one: { auto ptr = reinterpret_cast(value); return Createone(_fbb, ptr, _rehasher).Union(); } case myunion_two: { auto ptr = reinterpret_cast(value); return Createtwo(_fbb, ptr, _rehasher).Union(); } case myunion_three: { auto ptr = reinterpret_cast(value); return Createthree(_fbb, ptr, _rehasher).Union(); } default: return 0; } } inline myunionUnion::myunionUnion(const myunionUnion &u) : type(u.type), value(nullptr) { switch (type) { case myunion_one: { value = new oneT(*reinterpret_cast(u.value)); break; } case myunion_two: { value = new twoT(*reinterpret_cast(u.value)); break; } case myunion_three: { value = new threeT(*reinterpret_cast(u.value)); break; } default: break; } } inline void myunionUnion::Reset() { switch (type) { case myunion_one: { auto ptr = reinterpret_cast(value); delete ptr; break; } case myunion_two: { auto ptr = reinterpret_cast(value); delete ptr; break; } case myunion_three: { auto ptr = reinterpret_cast(value); delete ptr; break; } default: break; } value = nullptr; type = myunion_NONE; } inline const flatbuffers::TypeTable *myunionTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_SEQUENCE, 0, -1 }, { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 1 }, { flatbuffers::ET_SEQUENCE, 0, 2 } }; static const flatbuffers::TypeFunction type_refs[] = { oneTypeTable, twoTypeTable, threeTypeTable }; static const char * const names[] = { "NONE", "one", "two", "three" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_UNION, 4, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *testing_vecsTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_UINT, 1, -1 }, { flatbuffers::ET_STRING, 0, -1 } }; static const char * const names[] = { "myvecfortesting", "name" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 2, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *oneTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_FLOAT, 0, -1 } }; static const char * const names[] = { "fieldone" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *twoTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_FLOAT, 0, -1 } }; static const char * const names[] = { "fieldtwo" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *threeTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_FLOAT, 0, -1 } }; static const char * const names[] = { "fieldthree" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *very_nested_thingTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_ULONG, 0, -1 } }; static const char * const names[] = { "wow" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *composed_typeTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_STRING, 0, -1 }, { flatbuffers::ET_STRING, 1, -1 }, { flatbuffers::ET_INT, 0, -1 }, { flatbuffers::ET_SEQUENCE, 1, 0 } }; static const flatbuffers::TypeFunction type_refs[] = { very_nested_thingTypeTable }; static const char * const names[] = { "name", "comments", "index", "nnnnnn" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 4, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } inline const flatbuffers::TypeTable *testingunionsTypeTable() { static const flatbuffers::TypeCode type_codes[] = { { flatbuffers::ET_UTYPE, 0, 0 }, { flatbuffers::ET_SEQUENCE, 0, 0 }, { flatbuffers::ET_INT, 0, -1 } }; static const flatbuffers::TypeFunction type_refs[] = { myunionTypeTable }; static const char * const names[] = { "myfield_type", "myfield", "dumbfield" }; static const flatbuffers::TypeTable tt = { flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, nullptr, names }; return &tt; } #endif // FLATBUFFERS_GENERATED_TESTINGPROTOCOLS_H_ libsigmf-1.0.2/src/000077500000000000000000000000001434644465300141125ustar00rootroot00000000000000libsigmf-1.0.2/src/annotation.h000066400000000000000000000242261434644465300164430ustar00rootroot00000000000000/* * Copyright 2019, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LIBSIGMF_ANNOTATIONS_H #define LIBSIGMF_ANNOTATIONS_H #include "variadic_data_class.h" /* * Helper macros-- mixed opinions abound! */ #define ca0(x0) Annotation #define ca1(x0, x1) Annotation #define ca2(x0, x1, x2) Annotation #define ca3(x0, x1, x2, x3) Annotation #define ca4(x0, x1, x2, x3, x4) Annotation #define ca5(x0, x1, x2, x3, x4, x5) Annotation #define ca6(x0, x1, x2, x3, x4, x5, x6) Annotation #define ca7(x0, x1, x2, x3, x4, x5, x6, x7) Annotation #define ca8(x0, x1, x2, x3, x4, x5, x6, x7, x8) Annotation #define ca9(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) Annotation #define GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME #define create_annotation(...) GET_MACRO(__VA_ARGS__, ca9, ca8, ca7, ca6, ca5, ca4, ca3, ca2, ca1, ca0)(__VA_ARGS__) #define sigmfns(x) get() namespace sigmf { // This template is mostly here so we can specialize it. If we can get an expansion/loop of T... so that for every // T we can create a VariadicDataClass class Annotation : public VariadicDataClass { }; template class Annotation : public VariadicDataClass::element_type> { public: template auto &get() {// -> typename std::pointer_traits::element_type& { return this->template access::element_type>(); } }; template class Annotation : public VariadicDataClass::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Annotation : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Annotation : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Annotation : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Annotation : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Annotation : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Annotation : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Annotation : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Annotation : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; } // namespace sigmf #endif //LIBSIGMF_ANNOTATIONS_H libsigmf-1.0.2/src/capture.h000066400000000000000000000235441434644465300157360ustar00rootroot00000000000000/* * Copyright 2019, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LIBSIGMF_CAPTURE_H #define LIBSIGMF_CAPTURE_H #include "variadic_data_class.h" /* * Helper macros-- mixed opinions abound! */ #define cc0(x0) Capture #define cc1(x0, x1) Capture #define cc2(x0, x1, x2) Capture #define cc3(x0, x1, x2, x3) Capture #define cc4(x0, x1, x2, x3, x4) Capture #define cc5(x0, x1, x2, x3, x4, x5) Capture #define cc6(x0, x1, x2, x3, x4, x5, x6) Capture #define cc7(x0, x1, x2, x3, x4, x5, x6, x7) Capture #define cc8(x0, x1, x2, x3, x4, x5, x6, x7, x8) Capture #define cc9(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) Capture #define GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME #define create_capture(...) GET_MACRO(__VA_ARGS__, cc9, cc8, cc7, cc6, cc5, cc4, cc3, cc2, cc1, cc0)(__VA_ARGS__) namespace sigmf { // This template is mostly here so we can specialize it. If we can get an expansion/loop of T... so that for every // T we can create a VariadicDataClass class Capture : public VariadicDataClass { }; template class Capture : public VariadicDataClass::element_type> { public: template auto &get() {// -> typename std::pointer_traits::element_type& { return this->template access::element_type>(); } }; template class Capture : public VariadicDataClass::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Capture : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Capture : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Capture : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Capture : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Capture : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Capture : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Capture : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Capture : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; } // namespace sigmf #endif //LIBSIGMF_ANNOTATIONS_H libsigmf-1.0.2/src/collection.h000066400000000000000000000242231434644465300164210ustar00rootroot00000000000000/* * Copyright 2019, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LIBSIGMF_COLLECTION_H #define LIBSIGMF_COLLECTION_H #include "variadic_data_class.h" /* * Helper macros-- mixed opinions abound! */ #define cl0(x0) Collection #define cl1(x0, x1) Collection #define cl2(x0, x1, x2) Collection #define cl3(x0, x1, x2, x3) Collection #define cl4(x0, x1, x2, x3, x4) Collection #define cl5(x0, x1, x2, x3, x4, x5) Collection #define cl6(x0, x1, x2, x3, x4, x5, x6) Collection #define cl7(x0, x1, x2, x3, x4, x5, x6, x7) Collection #define cl8(x0, x1, x2, x3, x4, x5, x6, x7, x8) Collection #define cl9(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) Collection #define GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME #define create_collection(...) GET_MACRO(__VA_ARGS__, cl9, cl8, cl7, cl6, cl5, cl4, cl3, cl2, cl1, cl0)(__VA_ARGS__) #define sigmfns(x) get() namespace sigmf { // This template is mostly here so we cln specialize it. If we cln get an expansion/loop of T... so that for every // T we cln create a VariadicDataClass class Collection : public VariadicDataClass { }; template class Collection : public VariadicDataClass::element_type> { public: template auto &get() {// -> typename std::pointer_traits::element_type& { return this->template access::element_type>(); } }; template class Collection : public VariadicDataClass::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Collection : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Collection : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Collection : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Collection : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Collection : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Collection : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Collection : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Collection : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; } // namespace sigmf #endif //LIBSIGMF_COLLECTION_H libsigmf-1.0.2/src/flatbuffers_json_visitor.h000066400000000000000000000571141434644465300214060ustar00rootroot00000000000000/* * Copyright 2019, 2021, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LIBSIGMF_FLATBUFFERS_TO_JSON_VISITOR_H #define LIBSIGMF_FLATBUFFERS_TO_JSON_VISITOR_H #include "variadic_data_class.h" #include #include #include #include using json = nlohmann::json; namespace sigmf { /* * Designed to be run by our TypeIterator-- it adds fields to a flatbuffer (fbb) it owns by reading from a json * object given in its ctor. After the TypeIterator runs the flatbuffer can be made in to a specific flatbuffer * object or shipped somewhere */ struct FromSigMFVisitor : public flatbuffers::IterationVisitor { flatbuffers::uoffset_t _start; flatbuffers::uoffset_t _stop; json narrowest_json; std::string p; bool subtable; flatbuffers::voffset_t last_offset; std::string last_field_name; flatbuffers::FlatBufferBuilder fbb; flatbuffers::Offset last_fb_offset; explicit FromSigMFVisitor(std::string namespace_prefix, const json &j) : _start(0), _stop(0), p(namespace_prefix), subtable(false), last_offset(0) { fbb = flatbuffers::FlatBufferBuilder(); } void StartSequence() override { _start = fbb.StartTable(); } void EndSequence() override { _stop = fbb.EndTable(_start); } void Field(size_t field_idx, size_t set_idx, flatbuffers::ElementaryType e_type, bool is_vector, const flatbuffers::TypeTable *type_table, const char *name, const uint8_t *val, json jj) { narrowest_json = jj; // subtables do not have the namespace prefixed to the field name last_field_name = subtable ? name : p + name; last_offset = flatbuffers::FieldIndexToOffset(static_cast(field_idx)); } template void Named(T x, const char *name) { try { fbb.AddElement(last_offset, narrowest_json.at(last_field_name).get()); } catch (nlohmann::detail::out_of_range &e) { } } void UType(uint8_t x, const char *name) override { Named(x, name); } void Bool(bool x) override { try { fbb.AddElement(last_offset, narrowest_json.at(last_field_name).get()); } catch (nlohmann::detail::out_of_range &e) { } } void Char(int8_t x, const char *name) override { Named(x, name); } void UChar(uint8_t x, const char *name) override { Named(x, name); } void Short(int16_t x, const char *name) override { Named(x, name); } void UShort(uint16_t x, const char *name) override { Named(x, name); } void Int(int32_t x, const char *name) override { Named(x, name); } void UInt(uint32_t x, const char *name) override { Named(x, name); } void Long(int64_t x) override { try { fbb.AddElement(last_offset, narrowest_json.at(last_field_name).get()); } catch (nlohmann::detail::out_of_range &e) { } } void ULong(uint64_t x) override { try { fbb.AddElement(last_offset, narrowest_json.at(last_field_name).get()); } catch (nlohmann::detail::out_of_range &e) { } } void Float(float x) override { try { fbb.AddElement(last_offset, narrowest_json.at(last_field_name).get()); } catch (nlohmann::detail::out_of_range &e) { } } void Double(double x) override { try { fbb.AddElement(last_offset, narrowest_json.at(last_field_name).get()); } catch (nlohmann::detail::out_of_range &e) { } } void String(const struct flatbuffers::String *str) override { try { auto strval = narrowest_json.at(last_field_name).get(); last_fb_offset = flatbuffers::Offset(fbb.CreateString(strval).o); } catch (nlohmann::detail::out_of_range &e) { last_fb_offset.o = 0; }; } void StartVector() override { std::cout << "the visitor was called on startvector... not implemented" << std::endl; } void EndVector() override { std::cout << "the visitor was called on endvector... not implemented" << std::endl; } void Element(size_t i, flatbuffers::ElementaryType /*type*/, const flatbuffers::TypeTable * /*type_table*/, const uint8_t * /*val*/) override {} }; template flatbuffers::Offset json_vector_to_flatbuffer(flatbuffers::FlatBufferBuilder &fbb, const json &jvec) { std::vector tmpvec; tmpvec.reserve(jvec.size()); for (auto elem = jvec.begin(); elem != jvec.end(); ++elem) { tmpvec.emplace_back(elem->get()); } return flatbuffers::Offset(fbb.CreateVector(tmpvec).o); } inline flatbuffers::Offset json_vector_to_chararray(flatbuffers::FlatBufferBuilder &fbb, const json &jvec, flatbuffers::ElementaryType type) { //size_t num_elements = jvec.size(); switch (type) { case flatbuffers::ET_UTYPE: { auto rvec = jvec.get >(); return flatbuffers::Offset(fbb.CreateVector(rvec).o); } case flatbuffers::ET_BOOL: { auto rvec = jvec.get >(); return flatbuffers::Offset(fbb.CreateVector(rvec).o); } case flatbuffers::ET_CHAR: { auto rvec = jvec.get >(); return flatbuffers::Offset(fbb.CreateVector(rvec).o); } case flatbuffers::ET_UCHAR: { auto rvec = jvec.get >(); return flatbuffers::Offset(fbb.CreateVector(rvec).o); } case flatbuffers::ET_SHORT: return json_vector_to_flatbuffer(fbb, jvec); case flatbuffers::ET_USHORT: { return json_vector_to_flatbuffer(fbb, jvec); } case flatbuffers::ET_INT: return json_vector_to_flatbuffer(fbb, jvec); case flatbuffers::ET_UINT: { return json_vector_to_flatbuffer(fbb, jvec); } case flatbuffers::ET_LONG: return json_vector_to_flatbuffer(fbb, jvec); case flatbuffers::ET_ULONG: { return json_vector_to_flatbuffer(fbb, jvec); } case flatbuffers::ET_FLOAT: { return json_vector_to_flatbuffer(fbb, jvec); } case flatbuffers::ET_DOUBLE: { return json_vector_to_flatbuffer(fbb, jvec); } default: throw std::runtime_error("libsigmf cannot make a vector of this type yet"); } } /** * Iterate through a typetable-- I'll be honest here. This is kind of bullshit. We need to create all of * the types like Strings, Lists, Vectors, and other flatbuffer types before we create our table. I'm not * sure there's a better way to fill in the buffer than iterate over it twice-- i wonder how flatbuffers * does this internally (look at Parsers). We're just going to construct shit in the fbb in the first loop * and then fill in the fixed-width fields. I know this does the string creation correctly, but I don't * know that lists(Vectors) or other tables/structs will work. The Vectors and Tables will probably require * some recursion * * @param type_table the table to iterate over * @param visitor the visitor responsible for creating objects and adding fields to its internal flatbufferbuilder */ inline void IterateType(const flatbuffers::TypeTable *type_table, FromSigMFVisitor *visitor, json original_json, bool subtable=false) { if (original_json.is_null()) return; // empty table, not a problem const uint8_t *prev_val = nullptr; const uint8_t val[8] = {}; auto comosite_type_offsets = std::map >(); // Generate the strings up front (because they must be created before our Table in the flatbuffer) for (size_t i = 0; i < type_table->num_elems; i++) { auto type_code = type_table->type_codes[i]; auto type = static_cast(type_code.base_type); auto is_vector = type_code.is_repeating; auto ref_idx = type_code.sequence_ref; const flatbuffers::TypeTable *ref = nullptr; if (ref_idx >= 0) { ref = type_table->type_refs[ref_idx](); } auto name = type_table->names ? type_table->names[i] : nullptr; visitor->subtable = subtable; // The thing is, at least on this iteration we don't care about making real elementary types, just the // ones that need an offset auto field_name = subtable ? name : visitor->p + name; if (type < flatbuffers::ET_STRING) { if (is_vector) { auto vector_offset = json_vector_to_chararray(visitor->fbb, original_json[field_name], type); auto void_offset = flatbuffers::Offset(vector_offset.o); comosite_type_offsets[i] = void_offset; } } else if (type == flatbuffers::ET_STRING) { if (is_vector) { std::vector > vecofstrings; for (const auto &item : original_json[field_name]) { auto strval = item.get(); auto last_fb_offset = flatbuffers::Offset(visitor->fbb.CreateString(strval).o); vecofstrings.emplace_back(last_fb_offset); } auto vecoffset = flatbuffers::Offset(visitor->fbb.CreateVector(vecofstrings).o); comosite_type_offsets[i] = vecoffset; } else { if (!original_json[field_name].is_null()) { visitor->Field(i, 0, type, is_vector, ref, name, val, original_json); IterateValue(type, val, ref, prev_val, -1, visitor); comosite_type_offsets[i] = visitor->last_fb_offset; } } } else if (type == flatbuffers::ET_SEQUENCE) { if (is_vector) { std::vector > vecoftables; for (const auto &item : original_json[field_name]) { if (!item.is_null()) { auto seq_typetable = type_table->type_refs[ref_idx](); IterateType(seq_typetable, visitor, item, true); auto vecelement = flatbuffers::Offset(visitor->_stop); vecoftables.emplace_back(vecelement); } } auto vecoffset = flatbuffers::Offset(visitor->fbb.CreateVector(vecoftables).o); comosite_type_offsets[i] = vecoffset; } else { if (!original_json[field_name].is_null()) { auto seq_typetable = type_table->type_refs[ref_idx](); IterateType(seq_typetable, visitor, original_json[field_name], true); comosite_type_offsets[i] = flatbuffers::Offset(visitor->_stop); } } } } // Now make the table and fill in all of our types size_t set_idx = 0; visitor->StartSequence(); for (size_t i = 0; i < type_table->num_elems; i++) { auto type_code = type_table->type_codes[i]; auto type = static_cast(type_code.base_type); auto is_vector = type_code.is_repeating; auto ref_idx = type_code.sequence_ref; const flatbuffers::TypeTable *ref = nullptr; if (ref_idx >= 0) { ref = type_table->type_refs[ref_idx](); } auto name = type_table->names ? type_table->names[i] : nullptr; if (is_vector) { auto this_voffset = flatbuffers::FieldIndexToOffset(static_cast(i)); visitor->fbb.AddOffset(this_voffset, comosite_type_offsets.at(i)); } else if (type == flatbuffers::ET_STRING) { try { auto this_voffset = flatbuffers::FieldIndexToOffset(static_cast(i)); visitor->fbb.AddOffset(this_voffset, comosite_type_offsets.at(i)); } catch (std::out_of_range &e) { // this is ok... field wasn't present in json, not deserialized } } else if (type == flatbuffers::ET_SEQUENCE) { try { auto this_voffset = flatbuffers::FieldIndexToOffset(static_cast(i)); visitor->fbb.AddOffset(this_voffset, comosite_type_offsets.at(i)); } catch (std::out_of_range &e) { // this is ok... field wasn't present in json, not deserialized } } else { visitor->Field(i, set_idx, type, is_vector, ref, name, val, original_json); set_idx++; IterateValue(type, val, ref, prev_val, -1, visitor); } } visitor->EndSequence(); } template inline json FlatBufferVectorToJson(const flatbuffers::Vector *fbv) { std::vector vec; for (auto i = fbv->begin(); i != fbv->end(); i++) { vec.push_back(*i); } return json(vec); } // forward declare so we can create objects as fields inline json FlatBufferToJson(const uint8_t *buffer_root, const flatbuffers::TypeTable *typetable, const std::string &ns_prefix = ""); // TODO: function args are redundant since implementation of optional scalars... cleanup inline json flatbuffer_field_to_json(const uint8_t *buffer_root, const size_t elem, const flatbuffers::TypeTable *typetable = nullptr, const std::string &ns_prefix = "") { const flatbuffers::Table *tbl = reinterpret_cast(buffer_root); auto type_code = typetable->type_codes[elem]; auto type = static_cast(type_code.base_type); auto is_vector = type_code.is_repeating; auto buf_voffset = static_cast(elem); auto field_offset = flatbuffers::FieldIndexToOffset(buf_voffset); const uint8_t *val = tbl->GetAddressOf(field_offset); switch (type) { case flatbuffers::ET_UTYPE: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_BOOL: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_CHAR: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_UCHAR: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_SHORT: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_USHORT: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_INT: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_UINT: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_LONG: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_ULONG: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_FLOAT: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_DOUBLE: { if (is_vector) { return FlatBufferVectorToJson(tbl->GetPointer *>(field_offset)); } else { std::optional tval = tbl->GetOptional(field_offset); return tval.has_value() ? json(*tval) : json{}; } } case flatbuffers::ET_STRING: { if (is_vector) { const flatbuffers::Vector> *fbv = tbl->GetPointer> *>(field_offset); std::vector vec; for (auto i = fbv->begin(); i != fbv->end(); i++) { std::string s = i->str(); vec.push_back(s); } return json(vec); } else { auto tval = tbl->GetPointer(field_offset); return tval ? json(tval->c_str()) : json{}; } } case flatbuffers::ET_SEQUENCE: { switch (typetable->st) { case flatbuffers::ST_TABLE: if (is_vector) { const flatbuffers::Vector> *fbv = tbl->GetPointer> *>(field_offset); std::vector vec; for (auto i = fbv->begin(); i != fbv->end(); i++) { vec.push_back(FlatBufferToJson(reinterpret_cast(*i), typetable->type_refs[type_code.sequence_ref]())); } return json(vec); } else { val += flatbuffers::ReadScalar(val); return FlatBufferToJson(val, typetable->type_refs[type_code.sequence_ref]()); } default: // Have not implemented structs, unions, or enums which are all supported by flatbuffers // schema and would be great to have, but dont make as much sense in json-land. They're // on the todo list... break; } } default: // Nothing else should be here... break; } return json{}; } /** * A function to iterate through a flatbuffer that is described by the type and build up a json object to return. * The flatbuffer should have already been Finished, and the result of FlatBufferBuilder::Finish() -> GetRoot should * be the buffer_root. See variadic_data_class where we do the following: * auto bfrptr = fbb.GetBufferPointer(); * auto rtptr = flatbuffers::GetRoot(bfrptr); * * The gist of this is to get information about each field inside of a flatbuffers Table, then for each field, check * if there is a value. If so, serialize it to json and shove its value inside the json_object we want to return * using the name of the field as the key. */ inline json FlatBufferToJson(const uint8_t *buffer_root, const flatbuffers::TypeTable *typetable, const std::string &ns_prefix) { json json_object; const auto obj = reinterpret_cast(buffer_root); for (size_t i = 0; i < typetable->num_elems; i++) { // Gather all of the underlying info about this element in table auto type_code = typetable->type_codes[i]; auto type = static_cast(type_code.base_type); auto name = typetable->names ? typetable->names[i] : nullptr; const uint8_t *val = nullptr; // Fetch the actual value of this field now and stick it inside our json object if (typetable->st == flatbuffers::ST_TABLE) { auto field_offset = flatbuffers::FieldIndexToOffset(static_cast(i)); val = obj->GetAddressOf(field_offset); } else { // when does this get triggered? Probably when someone tries to pass a non-flattbuffers object // to us. Let's throw an exception so it'll be nice and obvious with a good test-case when this // happens. throw std::runtime_error( "libsigmf::FlatBufferToJson was called with a non-table type. Please file an issue with your fbs schema and input data."); } if (val) { json lval = flatbuffer_field_to_json(buffer_root, i, typetable, ns_prefix); if (!lval.is_null()) { // check this since empty subtables will pass `if (val)` json_object[ns_prefix + name] = lval; } } else { // There is no value in this field, this is OK as libsigmf does not enforce field presence } } return json_object; } } // namespace sigmf #endif //LIBSIGMF_FLATBUFFERS_TO_JSON_VISITOR_H libsigmf-1.0.2/src/flatbuffers_type_to_json.h000066400000000000000000000035741434644465300213730ustar00rootroot00000000000000/* * Copyright 2019, 2021, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "variadic_data_class.h" #include #include #ifndef OMNISIG_FLATBUFFERS_TYPE_TO_JSON_H #define OMNISIG_FLATBUFFERS_TYPE_TO_JSON_H using json = nlohmann::json; namespace sigmf { template static json to_json(const typename R::NativeTableType &obj) { R *ttype; flatbuffers::FlatBufferBuilder fbb; auto loc = ttype->Pack(fbb, &obj); fbb.Finish(loc); auto bfrptr = fbb.GetBufferPointer(); auto rtptr = flatbuffers::GetRoot(bfrptr); json asjson = FlatBufferToJson(rtptr, ttype->MiniReflectTypeTable(), ""); return asjson; } template static typename R::NativeTableType from_json(json json_value) { R *ttype; typename R::NativeTableType return_object; auto reflection_table = ttype->MiniReflectTypeTable(); FromSigMFVisitor dumb_ripoff_visitor("", json_value); IterateType(reflection_table, &dumb_ripoff_visitor, json_value); dumb_ripoff_visitor.fbb.Finish(flatbuffers::Offset(dumb_ripoff_visitor._stop)); auto *annoptr = flatbuffers::GetRoot(dumb_ripoff_visitor.fbb.GetBufferPointer()); annoptr->UnPackTo(&return_object); return return_object; } } // namespace sigmf #endif //OMNISIG_FLATBUFFERS_TYPE_TO_JSON_H libsigmf-1.0.2/src/global.h000066400000000000000000000234131434644465300155260ustar00rootroot00000000000000/* * Copyright 2019, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LIBSIGMF_GLOBAL_H #define LIBSIGMF_GLOBAL_H #include "variadic_data_class.h" /* * Helper macros-- mixed opinions abound! */ #define cg0(x0) Global #define cg1(x0, x1) Global #define cg2(x0, x1, x2) Global #define cg3(x0, x1, x2, x3) Global #define cg4(x0, x1, x2, x3, x4) Global #define cg5(x0, x1, x2, x3, x4, x5) Global #define cg6(x0, x1, x2, x3, x4, x5, x6) Global #define cg7(x0, x1, x2, x3, x4, x5, x6, x7) Global #define cg8(x0, x1, x2, x3, x4, x5, x6, x7, x8) Global #define cg9(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) Global #define GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME #define create_global(...) GET_MACRO(__VA_ARGS__, cg9, cg8, cg7, cg6, cg5, cg4, cg3, cg2, cg1, cg0)(__VA_ARGS__) namespace sigmf { // This template is mostly here so we can specialize it. If we can get an expansion/loop of T... so that for every // T we can create a VariadicDataClass class Global : public VariadicDataClass { }; template class Global : public VariadicDataClass::element_type> { public: template auto &get() {// -> typename std::pointer_traits::element_type& { return this->template access::element_type>(); } }; template class Global : public VariadicDataClass::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Global : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Global : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Global : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Global : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Global : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Global : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Global : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; template class Global : public VariadicDataClass::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type, typename std::pointer_traits::element_type> { public: template auto &get() { return this->template access::element_type>(); } }; } // namespace sigmf #endif //LIBSIGMF_ANNOTATIONS_H libsigmf-1.0.2/src/sigmf.h000066400000000000000000000064571434644465300154040ustar00rootroot00000000000000/* * Copyright 2019, 2021, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LIBSIGMF_SIGMF_H #define LIBSIGMF_SIGMF_H #include "variadic_data_class.h" #include "global.h" #include "capture.h" #include "annotation.h" #include "collection.h" #include "sigmf_core_generated.h" #include "sigmf_antenna_generated.h" #include "sigmf_capture_details_generated.h" #include "sigmf_signal_generated.h" #include #include namespace sigmf { template class SigMFVector : public std::vector { public: T &create_new() { T new_element; this->emplace_back(new_element); return this->back(); } }; template struct SigMF { GlobalType global; SigMFVector captures; SigMFVector annotations; /** * Export the record to a JSON object */ json to_json() const { json j; j["global"] = global.to_json(); j["captures"] = captures; j["annotations"] = annotations; return j; } /** * Write over the fields with a new record from a JSON object */ void from_json(const json &j) { global.from_json(j["global"]); captures.clear(); annotations.clear(); for (auto &element : j["annotations"]) { AnnotationType a; a.from_json(element); annotations.emplace_back(a); } for (auto &element : j["captures"]) { CaptureType c; c.from_json(element); captures.emplace_back(c); } } }; template struct SigMFCollection { CollectionType collection; /** * Export the record to a JSON object */ json to_json() const { json j; j["collection"] = collection.to_json(); return j; } /** * Write over the fields with a new record from a JSON object */ void from_json(const json &j) { collection.from_json(j["collection"]); } }; /* * This makes conversion between json types and SigMF types work out of the box */ template void to_json(json &j, const SigMF &t) { j = t.to_json(); } template void from_json(const json &j, SigMF &t) { t.from_json(j); } template void to_json(json &j, const SigMFCollection &t) { j = t.to_json(); } template void from_json(const json &j, SigMFCollection &t) { t.from_json(j); } } // namespace sigmf #endif //LIBSIGMF_SIGMF_H libsigmf-1.0.2/src/sigmf_helpers.h000066400000000000000000000257261434644465300171260ustar00rootroot00000000000000/* * Copyright 2019, 2021, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SIGMF_HELPERS_H #define SIGMF_HELPERS_H #include "sigmf.h" #include "sigmf_core_generated.h" #include "sigmf_antenna_generated.h" #include "sigmf_capture_details_generated.h" #include "sigmf_signal_generated.h" #include namespace sigmf { /** * * Sort elements of SigMF Vector * * Standard in place sort using sample_start as the comparand * * @param sigmf_vector SigMF vector to be sorted */ template void sort_sigmf_vector(sigmf::SigMFVector &sigmf_vector) { std::sort(sigmf_vector.begin(), sigmf_vector.end(), [](typename sigmf::SigMFVector::value_type first, typename sigmf::SigMFVector::value_type second) -> bool { return (first.template get().sample_start < second.template get().sample_start); }); } /** * * Get SigMF element applicable to sample * * NOTE: SigMF Vector should be validated before calling this function * * @param sample_number The sample_start of target annotation * @param sigmf_vector Reference to non-empty SigMF vector * @return Iterator to SigMF element * */ template typename VectorT::iterator get_first_of_sigmf_vector(ComparisonT sample_number, VectorT &sigmf_vector) { // get iterator to first SigMF item with a sample_start greater than the reference sample_start // NOTE: if no capture sample_start is greater then `upper_bound === sigmf_vector.end()` if(sigmf_vector.empty()) { throw std::runtime_error("Invalid memory access attempted on SigMF vector."); } auto upper_bound = std::upper_bound(sigmf_vector.begin(), sigmf_vector.end(), sample_number, [](ComparisonT sample_number_to_compare, typename VectorT::value_type first ) -> bool { return sample_number_to_compare < first.template get().sample_start; } ); // return the capture right before the upper_bound return (upper_bound - 1); } /** * * Get a subset of SigMF data that applies to a specific number of samples, * and normalized to a sample_start, from a larger set of SigMF data * * @param input_md Full set of SigMF data * @param segment_sample_start Starting sample to normalize * @param segment_sample_count Number of samples in subset * * @return Applicable subset of SigMF data * */ template sigmf::SigMF get_sigmf_in_range(sigmf::SigMF &input_md, uint64_t segment_sample_start, uint64_t segment_sample_count) { sigmf::SigMF new_md; // Copy global data to latest_metadata new_md.global = input_md.global; // Copy the normalized captures in range to the latest_metadata sort_sigmf_vector(input_md.captures); auto applicable_capture = get_first_of_sigmf_vector(segment_sample_start, input_md.captures); while (applicable_capture != input_md.captures.end() && (applicable_capture->template get().sample_start < (segment_sample_start + segment_sample_count))) { auto new_capture = *applicable_capture; if (segment_sample_start < new_capture.template get().sample_start.value_or(0)) { new_capture.template get().sample_start = new_capture.template get().sample_start.value_or(0) - segment_sample_start; } else { new_capture.template get().sample_start = 0; } new_md.captures.emplace_back(new_capture); ++applicable_capture; } // Copy the annotations in range to the latest_metadata sort_sigmf_vector(input_md.annotations); auto original_annotation = input_md.annotations.begin(); while (original_annotation != input_md.annotations.end()) { bool increment_iterator = true; core::AnnotationT &original_annotation_md = original_annotation->template get(); if (!original_annotation_md.sample_start.has_value()) { continue; // this is not a valid annotation, skip it } if (original_annotation_md.sample_start.value() >= (segment_sample_start + segment_sample_count)) { // annotations are in sorted order, if above is true, all other annotations will be out of bounds break; } else if ((original_annotation_md.sample_start.value() + original_annotation_md.sample_count.value_or(0)) > segment_sample_start) { auto new_annotation = *original_annotation; uint64_t start_offset = std::max(original_annotation_md.sample_start.value(), segment_sample_start); uint64_t count_from_new_offset = original_annotation_md.sample_start.value() + original_annotation_md.sample_count.value_or(0) - start_offset; uint64_t new_start = start_offset - segment_sample_start; uint64_t new_count = std::min(count_from_new_offset, segment_sample_count - new_start); auto first_applicable_capture = get_first_of_sigmf_vector(new_start, new_md.captures); auto new_sample_last = new_start + new_count - 1; auto last_applicable_capture = get_first_of_sigmf_vector(new_sample_last, new_md.captures); if (first_applicable_capture != last_applicable_capture) { auto next_applicable_capture = first_applicable_capture + 1; new_count = next_applicable_capture->template get().sample_start.value() - new_start; auto implicit_annotation = *original_annotation; implicit_annotation.template get().sample_start = next_applicable_capture->template get().sample_start.value() + segment_sample_start; original_annotation_md.sample_count = implicit_annotation.template get().sample_start.value() - original_annotation_md.sample_start.value(); implicit_annotation.template get().sample_count = implicit_annotation.template get().sample_count.value_or(0) - original_annotation_md.sample_count.value_or(0); if (implicit_annotation.template get().sample_start.value() < (segment_sample_start + segment_sample_count)) { original_annotation = input_md.annotations.insert((original_annotation + 1), implicit_annotation); increment_iterator = false; } } new_annotation.template get().sample_start = new_start; new_annotation.template get().sample_count = new_count; new_md.annotations.emplace_back(new_annotation); } if (increment_iterator) { original_annotation++; } } return std::move(new_md); } /** * * Read data from SigMF file into SigMF object * * @param meta_file Constant reference input file stream * @return Pointer to SigMF object * */ static std::unique_ptr, sigmf::Capture, sigmf::Annotation>> metadata_file_to_json(const std::ifstream &meta_file) { std::ostringstream meta_buffer; meta_buffer << meta_file.rdbuf(); auto sigmf_md = std::make_unique, sigmf::Capture, sigmf::Annotation>>(); *sigmf_md = json::parse(meta_buffer.str()); return sigmf_md; } /** * * Returns the size of a single data sample in bytes given the datatype string * * @param datatype_string * @return size of a sample in bytes */ static uint32_t get_sample_size(std::string dtype_str) { uint32_t sample_size; // possible bit widths are 64, 32, 16, 8 if (dtype_str.find("64") != std::string::npos) { sample_size = 8; } else if (dtype_str.find("32") != std::string::npos) { sample_size = 4; } else if (dtype_str.find("16") != std::string::npos) { sample_size = 2; } else if (dtype_str.find("8") != std::string::npos) { sample_size = 1; } else { throw std::invalid_argument("Invalid datatype string."); } if (dtype_str.at(0) == 'c') { sample_size *= 2; } return sample_size; } struct SigMFCaptureBoundary { uint64_t start_byte; uint64_t stop_byte; }; /** * * Returns the file byte start offset for a given captures array * * @param captures_vector SigMF captures vector * @param index specific capture to return information for * @param sample_size size of one sample in bytes */ template static SigMFCaptureBoundary get_capture_range(sigmf::SigMFVector &captures_vector, int index, int sample_size) { if (index >= captures_vector.size()) { // index exceeds captures vector length, no data to read return SigMFCaptureBoundary{0,0}; } SigMFCaptureBoundary bounds; bounds.start_byte = captures_vector[0].template get().header_bytes.value_or(0); for (auto ii = 1; ii <= index; ii++) { bounds.start_byte += captures_vector[ii].template get().header_bytes.value_or(0); } bounds.start_byte += captures_vector[index].template get().sample_start * sample_size; bounds.stop_byte = bounds.start_byte + captures_vector[index].template get().sample_start * sample_size; return bounds; } } // namespace sigmf #endif //OMNISIG_SIGMF_HELPERS_H libsigmf-1.0.2/src/variadic_data_class.h000066400000000000000000000212621434644465300202260ustar00rootroot00000000000000/* * Copyright 2019, 2021, 2022 DeepSig Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LIBSIGMF_VARIADICDATACLASS_H #define LIBSIGMF_VARIADICDATACLASS_H #include "flatbuffers_json_visitor.h" #include #include #include #include namespace sigmf { template struct SameType { static const bool value = false; }; template struct SameType { static const bool value = true; }; template struct ReachedEnd { static const bool value = false; }; template struct ReachedEnd { static const bool value = true; }; template class VariadicDataClass { public: /** * Access a reference to the (first) element of the tuple that is of type T * @tparam T * @return */ template T &access() { return MatchingField<0, T, sigmftypes, SigMFNamespaceOfType<0, T>::value>::get(sigmf_namespaces); } /** * Overload of access that accepts an object of type T rather than type T as template param * @tparam T * @return */ template T &access(T) { return access(); } template T &operator[](T) { return access(); } /** * return a json object representing the data class with namespaces to match sigmf-spec * @return */ json to_json() const { constexpr auto tuple_size = std::tuple_size::value; constexpr auto at_the_end = ReachedEnd<0, tuple_size>::value; json r = TupleIterator<0, sigmftypes, at_the_end>::to_json(sigmf_namespaces); return r; } /** * fill in data elements from a json object * @return */ void from_json(json j) { constexpr auto tuple_size = std::tuple_size::value; constexpr auto at_the_end = ReachedEnd<0, tuple_size>::value; TupleIterator<0, sigmftypes, at_the_end>::from_json(sigmf_namespaces, j); } private: typedef std::tuple sigmftypes; sigmftypes sigmf_namespaces; /** * Convenience class for iterating over every element in Tuple at compile time. * @tparam Index * @tparam Size * @tparam Tuple * @tparam End */ template struct TupleIterator { /** * Stringify the object's namespace (using cxxabi from compiler) so we can use the literal * c++ namespace as a prefix in the sigmf record (the sigmf namespace); this function also * removes the outer `sigmf::` class form the literal namespace * @tparam T * @param ttype * @return */ template static std::string get_namespace(const T *ttype) { // TODO: can we do this once at compile-time/ctor, store result, and just look it up? std::string mangled_name = typeid(ttype).name(); size_t size_of_demangled_name = 1024; char *demangled_name = static_cast(malloc(size_of_demangled_name)); int status; demangled_name = abi::__cxa_demangle(mangled_name.c_str(), demangled_name, &size_of_demangled_name, &status); auto demangled_string = std::string(demangled_name); free(static_cast(demangled_name)); auto ns_start = demangled_string.find("::"); auto ns_end = demangled_string.rfind("::"); auto ns_part = std::string(""); if (ns_start != std::string::npos && ns_end != std::string::npos) { ns_start += 2; ns_part = demangled_string.substr(ns_start, ns_end - ns_start + 1); } return ns_part; } /** * Iterate through the types in tuple (namespaces) creating a json object with field * names prefixed by the object's owning namespace * @param tp * @return */ static json to_json(const Tuple &tp) { typename std::tuple_element::type::TableType *ttype=nullptr; auto &flatbuffers_type = std::get(tp); auto reflection_table = ttype->MiniReflectTypeTable(); std::string namespace_part = get_namespace(ttype); flatbuffers::FlatBufferBuilder fbb; auto loc = ttype->Pack(fbb, &flatbuffers_type); fbb.Finish(loc); auto bfrptr = fbb.GetBufferPointer(); auto rtptr = flatbuffers::GetRoot(bfrptr); json asjson = FlatBufferToJson(rtptr, reflection_table, namespace_part); constexpr auto next = Index + 1; constexpr auto size = std::tuple_size::value; json existing_vals = TupleIterator::value>::to_json(tp); for (auto &val : asjson.items()) { existing_vals[val.key()] = val.value(); } return existing_vals; } /** * From json with namespaces ("core:fieldname", core is the namespace) fill in the corresponding fields * of our tuple'd objects * @param tp * @param j */ static void from_json(Tuple &tp, const json j) { typename std::tuple_element::type::TableType *ttype=nullptr; auto &flatbuffers_type = std::get(tp); auto reflection_table = ttype->MiniReflectTypeTable(); std::string namespace_part = get_namespace(ttype); FromSigMFVisitor dumb_ripoff_visitor(namespace_part, j); IterateType(reflection_table, &dumb_ripoff_visitor, j); dumb_ripoff_visitor.fbb.Finish(flatbuffers::Offset(dumb_ripoff_visitor._stop)); auto *annoptr = flatbuffers::GetRoot::type::TableType>( dumb_ripoff_visitor.fbb.GetBufferPointer()); annoptr->UnPackTo(&flatbuffers_type); constexpr auto next = Index + 1; constexpr auto size = std::tuple_size::value; TupleIterator::value>::from_json(tp, j); } }; /** * Template specialization for reaching the end of compile-time loop over Tuple * @tparam Index * @tparam Size * @tparam Tuple */ template struct TupleIterator { static json to_json(const Tuple &tp) { json r; return r; } static void from_json(const Tuple &tp, json j) { } }; /** * Convenience class for determining if the Nth element of sigmftypes is of type T. Will have bool ::value * @tparam N * @tparam T */ template struct SigMFNamespaceOfType : SameType::type> { }; /** * MatchingField::get to compile-time loop over sigmf_namespaces until the current index N is of type T * at which point it calls the end-condition (because of the template specialization) * @tparam N * @tparam T * @tparam Tuple * @tparam Match */ template struct MatchingField { static T &get(const Tuple &tp) { return MatchingField::value>::get(tp); } }; /** * MatchingField::get template-specializes the loop condition (true) to match when the object in Tuple at * index N is of type T. * @tparam N * @tparam T * @tparam Tuple */ template struct MatchingField { static T &get(const Tuple &tp) { return const_cast(std::get(tp)); } }; }; template void to_json(json &j, const VariadicDataClass t) { j = t.to_json(); } template void from_json(json &j, const VariadicDataClass t) { t.from_json(j); } } // namespace sigmf #endif